diff options
| author | Rosen Penev | 2024-10-19 22:51:51 +0000 |
|---|---|---|
| committer | Petr Štetiar | 2024-11-28 18:46:18 +0000 |
| commit | ec774fafe60763376f0dd82d34c621eea48dfa5f (patch) | |
| tree | ba102d78f1a9126af22df65716e43c332f1b10d6 | |
| parent | e5a20b0f49070f17ac54c7d651dadc3a0a803d03 (diff) | |
| download | openwrt-ec774fafe60763376f0dd82d34c621eea48dfa5f.tar.gz | |
ath79: gpio-rb91x-key: use gpiochip_get_data
No need for a custom function that does the same thing.
Oversight from devm conversion.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16748
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit e99b5832e801fdf2ec366419797360e09c2348c6)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
| -rw-r--r-- | target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c index b2c8e63305..02639cf011 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c @@ -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; @@ -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); |