mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
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>
This commit is contained in:
parent
370232d096
commit
9acdf6209f
1 changed files with 6 additions and 6 deletions
|
@ -14,8 +14,7 @@
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/bits.h>
|
#include <linux/bits.h>
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
/* FIXME: stop poking around inside gpiolib */
|
#include <linux/gpio/driver.h>
|
||||||
#include "../../gpio/gpiolib.h"
|
|
||||||
|
|
||||||
struct gpiomux {
|
struct gpiomux {
|
||||||
struct i2c_mux_gpio_platform_data data;
|
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++) {
|
for (i = 0; i < ngpios; i++) {
|
||||||
struct device *gpio_dev;
|
struct gpio_device *gdev;
|
||||||
|
struct device *dev;
|
||||||
struct gpio_desc *gpiod;
|
struct gpio_desc *gpiod;
|
||||||
enum gpiod_flags flag;
|
enum gpiod_flags flag;
|
||||||
|
|
||||||
|
@ -195,9 +195,9 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
|
||||||
if (!muxc->mux_locked)
|
if (!muxc->mux_locked)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* FIXME: find a proper way to access the GPIO device */
|
gdev = gpiod_to_gpio_device(gpiod);
|
||||||
gpio_dev = &gpiod->gdev->dev;
|
dev = gpio_device_to_device(gdev);
|
||||||
muxc->mux_locked = i2c_root_adapter(gpio_dev) == root;
|
muxc->mux_locked = i2c_root_adapter(dev) == root;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (muxc->mux_locked)
|
if (muxc->mux_locked)
|
||||||
|
|
Loading…
Reference in a new issue