diff options
author | Simon Glass <sjg@chromium.org> | 2016-03-06 19:27:51 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2016-03-17 10:27:22 +0800 |
commit | 17c43f1a42135cdca28991658615323c2ca92e37 (patch) | |
tree | c431d3eded5445758fe6c95853749a5e6d01da5f /drivers/gpio | |
parent | bbf2478026c0addfff000f31cc1b5639cbff52cb (diff) |
gpio: Use const where possible
Some functions do not change the struct gpio_desc parameter. Update these to
use const so this is clear.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-uclass.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index b2a2ca85cd..b58d4e64e8 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -257,7 +257,7 @@ int gpio_free(unsigned gpio) return _dm_gpio_free(desc.dev, desc.offset); } -static int check_reserved(struct gpio_desc *desc, const char *func) +static int check_reserved(const struct gpio_desc *desc, const char *func) { struct gpio_dev_priv *uc_priv; @@ -324,7 +324,7 @@ int gpio_direction_output(unsigned gpio, int value) desc.offset, value); } -int dm_gpio_get_value(struct gpio_desc *desc) +int dm_gpio_get_value(const struct gpio_desc *desc) { int value; int ret; @@ -338,7 +338,7 @@ int dm_gpio_get_value(struct gpio_desc *desc) return desc->flags & GPIOD_ACTIVE_LOW ? !value : value; } -int dm_gpio_set_value(struct gpio_desc *desc, int value) +int dm_gpio_set_value(const struct gpio_desc *desc, int value) { int ret; @@ -577,7 +577,7 @@ int gpio_get_values_as_int(const int *gpio_list) return vector; } -int dm_gpio_get_values_as_int(struct gpio_desc *desc_list, int count) +int dm_gpio_get_values_as_int(const struct gpio_desc *desc_list, int count) { unsigned bitmask = 1; unsigned vector = 0; @@ -766,7 +766,7 @@ static int gpio_renumber(struct udevice *removed_dev) return 0; } -int gpio_get_number(struct gpio_desc *desc) +int gpio_get_number(const struct gpio_desc *desc) { struct udevice *dev = desc->dev; struct gpio_dev_priv *uc_priv; |