diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-04 17:44:16 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-01-05 13:21:03 +0300 |
commit | e51b55236ca61a87bf8d1d61e8366726f7ea704c (patch) | |
tree | 51a82eac9654fe84d87bf92f86d832f40e60aa84 /drivers/gpio/gpio-bt8xx.c | |
parent | ba4a74485a32c1a5ea04e9ce9318cd73ed746fe2 (diff) | |
download | linux-e51b55236ca61a87bf8d1d61e8366726f7ea704c.tar.xz |
gpio: bt8xx: use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().
Cc: Michael Buesch <m@bues.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-bt8xx.c')
-rw-r--r-- | drivers/gpio/gpio-bt8xx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-bt8xx.c b/drivers/gpio/gpio-bt8xx.c index 7e4c43c18960..acefb25e8eca 100644 --- a/drivers/gpio/gpio-bt8xx.c +++ b/drivers/gpio/gpio-bt8xx.c @@ -80,7 +80,7 @@ MODULE_PARM_DESC(gpiobase, "The GPIO number base. -1 means dynamic, which is the static int bt8xxgpio_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 outen, data; @@ -101,7 +101,7 @@ static int bt8xxgpio_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) static int bt8xxgpio_gpio_get(struct gpio_chip *gpio, unsigned nr) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 val; @@ -115,7 +115,7 @@ static int bt8xxgpio_gpio_get(struct gpio_chip *gpio, unsigned nr) static int bt8xxgpio_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, int val) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 outen, data; @@ -140,7 +140,7 @@ static int bt8xxgpio_gpio_direction_output(struct gpio_chip *gpio, static void bt8xxgpio_gpio_set(struct gpio_chip *gpio, unsigned nr, int val) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 data; @@ -217,7 +217,7 @@ static int bt8xxgpio_probe(struct pci_dev *dev, bgwrite(0, BT848_GPIO_OUT_EN); bt8xxgpio_gpio_setup(bg); - err = gpiochip_add(&bg->gpio); + err = gpiochip_add_data(&bg->gpio, bg); if (err) { printk(KERN_ERR "bt8xxgpio: Failed to register GPIOs\n"); goto err_disable; |