diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-10-11 15:02:04 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-10-13 08:50:08 +0200 |
commit | 9acdf6209f226846cc1e354a6b3da3c927898926 (patch) | |
tree | 6284c35198e6ffcffaff3c68815942f186550f84 /drivers/i2c/muxes | |
parent | 370232d096e3fe188e4596f77bc6560636bd40c1 (diff) |
i2c: mux: gpio: don't fiddle with GPIOLIB internals
Use the relevant API functions to retrieve the address of the
underlying struct device instead of accessing GPIOLIB private structures
manually.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Peter Rosin <peda@axentia.se>
Acked-by: Wolfram Sang <wsa@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/i2c/muxes')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-gpio.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 5d5cbe0130cd..48a872a8196b 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c @@ -14,8 +14,7 @@ #include <linux/slab.h> #include <linux/bits.h> #include <linux/gpio/consumer.h> -/* FIXME: stop poking around inside gpiolib */ -#include "../../gpio/gpiolib.h" +#include <linux/gpio/driver.h> struct gpiomux { struct i2c_mux_gpio_platform_data data; @@ -176,7 +175,8 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev) } for (i = 0; i < ngpios; i++) { - struct device *gpio_dev; + struct gpio_device *gdev; + struct device *dev; struct gpio_desc *gpiod; enum gpiod_flags flag; @@ -195,9 +195,9 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev) if (!muxc->mux_locked) continue; - /* FIXME: find a proper way to access the GPIO device */ - gpio_dev = &gpiod->gdev->dev; - muxc->mux_locked = i2c_root_adapter(gpio_dev) == root; + gdev = gpiod_to_gpio_device(gpiod); + dev = gpio_device_to_device(gdev); + muxc->mux_locked = i2c_root_adapter(dev) == root; } if (muxc->mux_locked) |