mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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>
This commit is contained in:
parent
bbf2478026
commit
17c43f1a42
2 changed files with 10 additions and 10 deletions
|
@ -133,7 +133,7 @@ struct gpio_desc {
|
|||
* previously returned by gpio_request_by_name()
|
||||
* @return true if valid, false if not
|
||||
*/
|
||||
static inline bool dm_gpio_is_valid(struct gpio_desc *desc)
|
||||
static inline bool dm_gpio_is_valid(const struct gpio_desc *desc)
|
||||
{
|
||||
return desc->dev != NULL;
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ int gpio_get_values_as_int(const int *gpio_list);
|
|||
* @count: Number of GPIOs
|
||||
* @return resulting integer value, or -ve on error
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* gpio_claim_vector() - claim a number of GPIOs for input
|
||||
|
@ -536,9 +536,9 @@ int gpio_free_list_nodev(struct gpio_desc *desc, int count);
|
|||
* previously returned by gpio_request_by_name()
|
||||
* @return GPIO value (0 for inactive, 1 for active) or -ve on error
|
||||
*/
|
||||
int dm_gpio_get_value(struct gpio_desc *desc);
|
||||
int dm_gpio_get_value(const struct gpio_desc *desc);
|
||||
|
||||
int dm_gpio_set_value(struct gpio_desc *desc, int value);
|
||||
int dm_gpio_set_value(const struct gpio_desc *desc, int value);
|
||||
|
||||
/**
|
||||
* dm_gpio_set_dir() - Set the direction for a GPIO
|
||||
|
@ -577,6 +577,6 @@ int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags);
|
|||
* previously returned by gpio_request_by_name()
|
||||
* @return GPIO number, or -ve if not found
|
||||
*/
|
||||
int gpio_get_number(struct gpio_desc *desc);
|
||||
int gpio_get_number(const struct gpio_desc *desc);
|
||||
|
||||
#endif /* _ASM_GENERIC_GPIO_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue