ath79: gpio-latch-miktorik: use gpiochip_get_data

Oversight from devm conversion. No need for a custom static inline
function.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16747
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 6d2ed484fa)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
Rosen Penev 2024-10-19 15:49:42 -07:00 committed by Petr Štetiar
parent 0cf557876a
commit e5a20b0f49
No known key found for this signature in database
GPG Key ID: 58EE120F30CC02D3

View File

@ -28,11 +28,6 @@ struct gpio_latch_chip {
struct gpio_desc *gpios[GPIO_LATCH_LINES]; struct gpio_desc *gpios[GPIO_LATCH_LINES];
}; };
static inline struct gpio_latch_chip *to_gpio_latch_chip(struct gpio_chip *gc)
{
return container_of(gc, struct gpio_latch_chip, gc);
}
static void gpio_latch_lock(struct gpio_latch_chip *glc, bool enable) static void gpio_latch_lock(struct gpio_latch_chip *glc, bool enable)
{ {
mutex_lock(&glc->mutex); mutex_lock(&glc->mutex);
@ -58,7 +53,7 @@ static void gpio_latch_unlock(struct gpio_latch_chip *glc, bool disable)
static int static int
gpio_latch_get(struct gpio_chip *gc, unsigned offset) gpio_latch_get(struct gpio_chip *gc, unsigned offset)
{ {
struct gpio_latch_chip *glc = to_gpio_latch_chip(gc); struct gpio_latch_chip *glc = gpiochip_get_data(gc);
int ret; int ret;
gpio_latch_lock(glc, false); gpio_latch_lock(glc, false);
@ -71,7 +66,7 @@ gpio_latch_get(struct gpio_chip *gc, unsigned offset)
static void static void
gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value) gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value)
{ {
struct gpio_latch_chip *glc = to_gpio_latch_chip(gc); struct gpio_latch_chip *glc = gpiochip_get_data(gc);
bool enable_latch = false; bool enable_latch = false;
bool disable_latch = false; bool disable_latch = false;
@ -88,7 +83,7 @@ gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value)
static int static int
gpio_latch_direction_output(struct gpio_chip *gc, unsigned offset, int value) gpio_latch_direction_output(struct gpio_chip *gc, unsigned offset, int value)
{ {
struct gpio_latch_chip *glc = to_gpio_latch_chip(gc); struct gpio_latch_chip *glc = gpiochip_get_data(gc);
bool enable_latch = false; bool enable_latch = false;
bool disable_latch = false; bool disable_latch = false;
int ret; int ret;