diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-11-19 12:37:49 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2013-11-19 04:21:19 -0800 |
commit | 0d762fdf0fc8b5ec3849659795497fe5472e4f87 (patch) | |
tree | ae63fb6abb4514c316aa9d391854d3cdcd0cd157 /drivers/pinctrl | |
parent | 12d86ec31c2033099aaf6cccce78c56ae5bc7c15 (diff) |
pinctrl: tegra: return drive group ID from drive_get_pingroup()
Return the drive pingroup ID from the function drive_get_pingroup()
when device name found in drive strength table otherwise return
error as -EINVAL.
Change-Id: I6e5ce1316d210941dea00e3f17e3bce5b65bf683
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/332800
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-tegra.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c index 67f093651cf1..28906a20a79c 100644 --- a/drivers/pinctrl/pinctrl-tegra.c +++ b/drivers/pinctrl/pinctrl-tegra.c @@ -1741,12 +1741,16 @@ int tegra_pinctrl_pg_drive_get_pingroup(struct device *dev) return -EINVAL; dev_id = dev_name(dev); - for (pg = 0; pg < pmx->soc->ngroups; pg++) + for (pg = 0; pg < pmx->soc->ngroups; pg++) { if (pmx->soc->groups[pg].dev_id && - !(strcmp(pmx->soc->groups[pg].dev_id, dev_id))) + !(strcmp(pmx->soc->groups[pg].dev_id, dev_id))) { + if (pg >= pmx->drive_group_start_index) + pg -= pmx->drive_group_start_index; break; + } + } - return pg; + return (pg == pmx->soc->ngroups) ? -EINVAL : pg; } EXPORT_SYMBOL(tegra_pinctrl_pg_drive_get_pingroup); |