Commit 7c295975 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Grant Likely

gpio: make gpio_{request,free}_array gpio array parameter const

gpio_{request,free}_array should not (and do not) modify the passed gpio
array, so make the parameter const.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarEric Miao <eric.y.miao@gmail.com>
Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 3474cb3c
...@@ -1296,7 +1296,7 @@ EXPORT_SYMBOL_GPL(gpio_request_one); ...@@ -1296,7 +1296,7 @@ EXPORT_SYMBOL_GPL(gpio_request_one);
* @array: array of the 'struct gpio' * @array: array of the 'struct gpio'
* @num: how many GPIOs in the array * @num: how many GPIOs in the array
*/ */
int gpio_request_array(struct gpio *array, size_t num) int gpio_request_array(const struct gpio *array, size_t num)
{ {
int i, err; int i, err;
...@@ -1319,7 +1319,7 @@ EXPORT_SYMBOL_GPL(gpio_request_array); ...@@ -1319,7 +1319,7 @@ EXPORT_SYMBOL_GPL(gpio_request_array);
* @array: array of the 'struct gpio' * @array: array of the 'struct gpio'
* @num: how many GPIOs in the array * @num: how many GPIOs in the array
*/ */
void gpio_free_array(struct gpio *array, size_t num) void gpio_free_array(const struct gpio *array, size_t num)
{ {
while (num--) while (num--)
gpio_free((array++)->gpio); gpio_free((array++)->gpio);
......
...@@ -193,8 +193,8 @@ struct gpio { ...@@ -193,8 +193,8 @@ struct gpio {
}; };
extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
extern int gpio_request_array(struct gpio *array, size_t num); extern int gpio_request_array(const struct gpio *array, size_t num);
extern void gpio_free_array(struct gpio *array, size_t num); extern void gpio_free_array(const struct gpio *array, size_t num);
#ifdef CONFIG_GPIO_SYSFS #ifdef CONFIG_GPIO_SYSFS
......
...@@ -41,7 +41,7 @@ static inline int gpio_request_one(unsigned gpio, ...@@ -41,7 +41,7 @@ static inline int gpio_request_one(unsigned gpio,
return -ENOSYS; return -ENOSYS;
} }
static inline int gpio_request_array(struct gpio *array, size_t num) static inline int gpio_request_array(const struct gpio *array, size_t num)
{ {
return -ENOSYS; return -ENOSYS;
} }
...@@ -54,7 +54,7 @@ static inline void gpio_free(unsigned gpio) ...@@ -54,7 +54,7 @@ static inline void gpio_free(unsigned gpio)
WARN_ON(1); WARN_ON(1);
} }
static inline void gpio_free_array(struct gpio *array, size_t num) static inline void gpio_free_array(const struct gpio *array, size_t num)
{ {
might_sleep(); might_sleep();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment