diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-pxa3xx.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-pxa3xx.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/pinctrl/pinctrl-pxa3xx.c b/drivers/pinctrl/pinctrl-pxa3xx.c index 079dce0e93e..7644e42ac21 100644 --- a/drivers/pinctrl/pinctrl-pxa3xx.c +++ b/drivers/pinctrl/pinctrl-pxa3xx.c | |||
@@ -25,20 +25,18 @@ static struct pinctrl_gpio_range pxa3xx_pinctrl_gpio_range = { | |||
25 | .pin_base = 0, | 25 | .pin_base = 0, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | static int pxa3xx_list_groups(struct pinctrl_dev *pctrldev, unsigned selector) | 28 | static int pxa3xx_get_groups_count(struct pinctrl_dev *pctrldev) |
29 | { | 29 | { |
30 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); | 30 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); |
31 | if (selector >= info->num_grps) | 31 | |
32 | return -EINVAL; | 32 | return info->num_grps; |
33 | return 0; | ||
34 | } | 33 | } |
35 | 34 | ||
36 | static const char *pxa3xx_get_group_name(struct pinctrl_dev *pctrldev, | 35 | static const char *pxa3xx_get_group_name(struct pinctrl_dev *pctrldev, |
37 | unsigned selector) | 36 | unsigned selector) |
38 | { | 37 | { |
39 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); | 38 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); |
40 | if (selector >= info->num_grps) | 39 | |
41 | return NULL; | ||
42 | return info->grps[selector].name; | 40 | return info->grps[selector].name; |
43 | } | 41 | } |
44 | 42 | ||
@@ -48,25 +46,23 @@ static int pxa3xx_get_group_pins(struct pinctrl_dev *pctrldev, | |||
48 | unsigned *num_pins) | 46 | unsigned *num_pins) |
49 | { | 47 | { |
50 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); | 48 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); |
51 | if (selector >= info->num_grps) | 49 | |
52 | return -EINVAL; | ||
53 | *pins = info->grps[selector].pins; | 50 | *pins = info->grps[selector].pins; |
54 | *num_pins = info->grps[selector].npins; | 51 | *num_pins = info->grps[selector].npins; |
55 | return 0; | 52 | return 0; |
56 | } | 53 | } |
57 | 54 | ||
58 | static struct pinctrl_ops pxa3xx_pctrl_ops = { | 55 | static struct pinctrl_ops pxa3xx_pctrl_ops = { |
59 | .list_groups = pxa3xx_list_groups, | 56 | .get_groups_count = pxa3xx_get_groups_count, |
60 | .get_group_name = pxa3xx_get_group_name, | 57 | .get_group_name = pxa3xx_get_group_name, |
61 | .get_group_pins = pxa3xx_get_group_pins, | 58 | .get_group_pins = pxa3xx_get_group_pins, |
62 | }; | 59 | }; |
63 | 60 | ||
64 | static int pxa3xx_pmx_list_func(struct pinctrl_dev *pctrldev, unsigned func) | 61 | static int pxa3xx_pmx_get_funcs_count(struct pinctrl_dev *pctrldev) |
65 | { | 62 | { |
66 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); | 63 | struct pxa3xx_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); |
67 | if (func >= info->num_funcs) | 64 | |
68 | return -EINVAL; | 65 | return info->num_funcs; |
69 | return 0; | ||
70 | } | 66 | } |
71 | 67 | ||
72 | static const char *pxa3xx_pmx_get_func_name(struct pinctrl_dev *pctrldev, | 68 | static const char *pxa3xx_pmx_get_func_name(struct pinctrl_dev *pctrldev, |
@@ -170,7 +166,7 @@ static int pxa3xx_pmx_request_gpio(struct pinctrl_dev *pctrldev, | |||
170 | } | 166 | } |
171 | 167 | ||
172 | static struct pinmux_ops pxa3xx_pmx_ops = { | 168 | static struct pinmux_ops pxa3xx_pmx_ops = { |
173 | .list_functions = pxa3xx_pmx_list_func, | 169 | .get_functions_count = pxa3xx_pmx_get_funcs_count, |
174 | .get_function_name = pxa3xx_pmx_get_func_name, | 170 | .get_function_name = pxa3xx_pmx_get_func_name, |
175 | .get_function_groups = pxa3xx_pmx_get_groups, | 171 | .get_function_groups = pxa3xx_pmx_get_groups, |
176 | .enable = pxa3xx_pmx_enable, | 172 | .enable = pxa3xx_pmx_enable, |