Skip to content

Commit

Permalink
ath79: gpio-rb91x-key: use gpiochip_get_data
Browse files Browse the repository at this point in the history
No need for a custom function that does the same thing.

Oversight from devm conversion.

Signed-off-by: Rosen Penev <[email protected]>
Link: openwrt#16748
Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
neheb authored and robimarko committed Nov 3, 2024
1 parent 6d2ed48 commit e99b583
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,9 @@ struct gpio_rb91x_key {
struct gpio_desc *gpio;
};

static inline struct gpio_rb91x_key *to_gpio_rb91x_key(struct gpio_chip *gc)
{
return container_of(gc, struct gpio_rb91x_key, gc);
}

static int gpio_rb91x_key_get(struct gpio_chip *gc, unsigned offset)
{
struct gpio_rb91x_key *drvdata = to_gpio_rb91x_key(gc);
struct gpio_rb91x_key *drvdata = gpiochip_get_data(gc);
struct gpio_desc *gpio = drvdata->gpio;
int val, bak_val;

Expand Down Expand Up @@ -97,7 +92,7 @@ static int gpio_rb91x_key_direction_input(struct gpio_chip *gc, unsigned offset)

static void gpio_rb91x_key_set(struct gpio_chip *gc, unsigned offset, int value)
{
struct gpio_rb91x_key *drvdata = to_gpio_rb91x_key(gc);
struct gpio_rb91x_key *drvdata = gpiochip_get_data(gc);
struct gpio_desc *gpio = drvdata->gpio;

mutex_lock(&drvdata->mutex);
Expand Down

0 comments on commit e99b583

Please sign in to comment.