diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-10-19 18:19:25 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2011-10-20 05:41:49 -0400 |
commit | a5818a8bd095a08cfb1871b63af9c8bed103e4b9 (patch) | |
tree | 7fc2ade1186cc42877f21a0eead3843515b914be | |
parent | 393daa814f4bbc6f5c099178c073fae9f7ef6177 (diff) |
pinctrl: get_group_pins() const fixes
get_group_pins() "returns" a pointer to an array of const objects, through
a pointer parameter. Fix the prototype so what's pointed at by the returned
pointer is const, rather than the function parameter being const.
This also allows the removal of a cast in each of the two current pinmux
drivers.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/core.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/pinmux-sirf.c | 6 | ||||
-rw-r--r-- | drivers/pinctrl/pinmux-u300.c | 6 | ||||
-rw-r--r-- | drivers/pinctrl/pinmux.c | 4 | ||||
-rw-r--r-- | include/linux/pinctrl/pinctrl.h | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index b2eaf8d4412a..ceb63275c7fe 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -329,7 +329,7 @@ static int pinctrl_groups_show(struct seq_file *s, void *what) | |||
329 | 329 | ||
330 | seq_puts(s, "registered pin groups:\n"); | 330 | seq_puts(s, "registered pin groups:\n"); |
331 | while (ops->list_groups(pctldev, selector) >= 0) { | 331 | while (ops->list_groups(pctldev, selector) >= 0) { |
332 | unsigned *pins; | 332 | const unsigned *pins; |
333 | unsigned num_pins; | 333 | unsigned num_pins; |
334 | const char *gname = ops->get_group_name(pctldev, selector); | 334 | const char *gname = ops->get_group_name(pctldev, selector); |
335 | int ret; | 335 | int ret; |
diff --git a/drivers/pinctrl/pinmux-sirf.c b/drivers/pinctrl/pinmux-sirf.c index c48c5634201e..ddcea1820935 100644 --- a/drivers/pinctrl/pinmux-sirf.c +++ b/drivers/pinctrl/pinmux-sirf.c | |||
@@ -869,12 +869,12 @@ static const char *sirfsoc_get_group_name(struct pinctrl_dev *pctldev, | |||
869 | } | 869 | } |
870 | 870 | ||
871 | static int sirfsoc_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, | 871 | static int sirfsoc_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, |
872 | unsigned ** const pins, | 872 | const unsigned **pins, |
873 | unsigned * const num_pins) | 873 | const unsigned *num_pins) |
874 | { | 874 | { |
875 | if (selector >= ARRAY_SIZE(sirfsoc_pin_groups)) | 875 | if (selector >= ARRAY_SIZE(sirfsoc_pin_groups)) |
876 | return -EINVAL; | 876 | return -EINVAL; |
877 | *pins = (unsigned *) sirfsoc_pin_groups[selector].pins; | 877 | *pins = sirfsoc_pin_groups[selector].pins; |
878 | *num_pins = sirfsoc_pin_groups[selector].num_pins; | 878 | *num_pins = sirfsoc_pin_groups[selector].num_pins; |
879 | return 0; | 879 | return 0; |
880 | } | 880 | } |
diff --git a/drivers/pinctrl/pinmux-u300.c b/drivers/pinctrl/pinmux-u300.c index f9db1cebff00..71d23b736ff5 100644 --- a/drivers/pinctrl/pinmux-u300.c +++ b/drivers/pinctrl/pinmux-u300.c | |||
@@ -849,12 +849,12 @@ static const char *u300_get_group_name(struct pinctrl_dev *pctldev, | |||
849 | } | 849 | } |
850 | 850 | ||
851 | static int u300_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, | 851 | static int u300_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, |
852 | unsigned ** const pins, | 852 | const unsigned **pins, |
853 | unsigned * const num_pins) | 853 | unsigned *num_pins) |
854 | { | 854 | { |
855 | if (selector >= ARRAY_SIZE(u300_pin_groups)) | 855 | if (selector >= ARRAY_SIZE(u300_pin_groups)) |
856 | return -EINVAL; | 856 | return -EINVAL; |
857 | *pins = (unsigned *) u300_pin_groups[selector].pins; | 857 | *pins = u300_pin_groups[selector].pins; |
858 | *num_pins = u300_pin_groups[selector].num_pins; | 858 | *num_pins = u300_pin_groups[selector].num_pins; |
859 | return 0; | 859 | return 0; |
860 | } | 860 | } |
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 6544d98b2cf8..90fb00d9a8a2 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c | |||
@@ -326,7 +326,7 @@ static int acquire_pins(struct pinctrl_dev *pctldev, | |||
326 | const struct pinmux_ops *pmxops = pctldev->desc->pmxops; | 326 | const struct pinmux_ops *pmxops = pctldev->desc->pmxops; |
327 | const char *func = pmxops->get_function_name(pctldev, | 327 | const char *func = pmxops->get_function_name(pctldev, |
328 | func_selector); | 328 | func_selector); |
329 | unsigned *pins; | 329 | const unsigned *pins; |
330 | unsigned num_pins; | 330 | unsigned num_pins; |
331 | int ret; | 331 | int ret; |
332 | int i; | 332 | int i; |
@@ -367,7 +367,7 @@ static void release_pins(struct pinctrl_dev *pctldev, | |||
367 | unsigned group_selector) | 367 | unsigned group_selector) |
368 | { | 368 | { |
369 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; | 369 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
370 | unsigned *pins; | 370 | const unsigned *pins; |
371 | unsigned num_pins; | 371 | unsigned num_pins; |
372 | int ret; | 372 | int ret; |
373 | int i; | 373 | int i; |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 4f8d2089acce..3605e947fa90 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -75,8 +75,8 @@ struct pinctrl_ops { | |||
75 | unsigned selector); | 75 | unsigned selector); |
76 | int (*get_group_pins) (struct pinctrl_dev *pctldev, | 76 | int (*get_group_pins) (struct pinctrl_dev *pctldev, |
77 | unsigned selector, | 77 | unsigned selector, |
78 | unsigned ** const pins, | 78 | const unsigned **pins, |
79 | unsigned * const num_pins); | 79 | unsigned *num_pins); |
80 | void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s, | 80 | void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s, |
81 | unsigned offset); | 81 | unsigned offset); |
82 | }; | 82 | }; |