Skip to content

Commit c9ec045

Browse files
shramamoorthyBartosz Golaszewski
authored andcommitted
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>
1 parent 7cef813 commit c9ec045

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/gpio/gpio-tps65219.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#define TPS65219_GPIO0_DIR_MASK BIT(3)
1616
#define TPS65219_GPIO0_OFFSET 2
1717
#define TPS65219_GPIO0_IDX 0
18-
#define TPS65219_GPIO_DIR_IN 1
19-
#define TPS65219_GPIO_DIR_OUT 0
2018

2119
struct tps65219_gpio {
2220
struct gpio_chip gpio_chip;
@@ -61,7 +59,7 @@ static int tps65219_gpio_get(struct gpio_chip *gc, unsigned int offset)
6159
* status bit.
6260
*/
6361

64-
if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_OUT)
62+
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
6563
return -ENOTSUPP;
6664

6765
return ret;
@@ -124,10 +122,10 @@ static int tps65219_gpio_direction_input(struct gpio_chip *gc, unsigned int offs
124122
return -ENOTSUPP;
125123
}
126124

127-
if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_IN)
125+
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_IN)
128126
return 0;
129127

130-
return tps65219_gpio_change_direction(gc, offset, TPS65219_GPIO_DIR_IN);
128+
return tps65219_gpio_change_direction(gc, offset, GPIO_LINE_DIRECTION_IN);
131129
}
132130

133131
static int tps65219_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value)
@@ -136,10 +134,10 @@ static int tps65219_gpio_direction_output(struct gpio_chip *gc, unsigned int off
136134
if (offset != TPS65219_GPIO0_IDX)
137135
return 0;
138136

139-
if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_OUT)
137+
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
140138
return 0;
141139

142-
return tps65219_gpio_change_direction(gc, offset, TPS65219_GPIO_DIR_OUT);
140+
return tps65219_gpio_change_direction(gc, offset, GPIO_LINE_DIRECTION_OUT);
143141
}
144142

145143
static const struct gpio_chip tps65219_template_chip = {

0 commit comments

Comments
 (0)