Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: tps65219: Use existing kernel gpio macros

Replace the user-defined macros with the equivalent kernel macros provided.

The user-defined macros serve the same purpose as the common kernel macros.
The user-defined macros rely on the inference that _IN corresponds to true
and _OUT is false.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://lore.kernel.org/r/20241217204755.1011731-2-s-ramamoorthy@ti.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Shree Ramamoorthy and committed by
Bartosz Golaszewski
c9ec045f 7cef813a

+5 -7
+5 -7
drivers/gpio/gpio-tps65219.c
··· 15 15 #define TPS65219_GPIO0_DIR_MASK BIT(3) 16 16 #define TPS65219_GPIO0_OFFSET 2 17 17 #define TPS65219_GPIO0_IDX 0 18 - #define TPS65219_GPIO_DIR_IN 1 19 - #define TPS65219_GPIO_DIR_OUT 0 20 18 21 19 struct tps65219_gpio { 22 20 struct gpio_chip gpio_chip; ··· 59 61 * status bit. 60 62 */ 61 63 62 - if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_OUT) 64 + if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT) 63 65 return -ENOTSUPP; 64 66 65 67 return ret; ··· 122 124 return -ENOTSUPP; 123 125 } 124 126 125 - if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_IN) 127 + if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_IN) 126 128 return 0; 127 129 128 - return tps65219_gpio_change_direction(gc, offset, TPS65219_GPIO_DIR_IN); 130 + return tps65219_gpio_change_direction(gc, offset, GPIO_LINE_DIRECTION_IN); 129 131 } 130 132 131 133 static int tps65219_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value) ··· 134 136 if (offset != TPS65219_GPIO0_IDX) 135 137 return 0; 136 138 137 - if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_OUT) 139 + if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT) 138 140 return 0; 139 141 140 - return tps65219_gpio_change_direction(gc, offset, TPS65219_GPIO_DIR_OUT); 142 + return tps65219_gpio_change_direction(gc, offset, GPIO_LINE_DIRECTION_OUT); 141 143 } 142 144 143 145 static const struct gpio_chip tps65219_template_chip = {