diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-08 10:42:58 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-01-06 18:11:20 -0500 |
commit | 2a6643437083c4dc28169a706099cd22769be1f5 (patch) | |
tree | a1e1bddeb7f9e42e7c78e26ea6b30acfdcb1fafa | |
parent | 47513c2ff86e2afd345a9aea3c5626f71cf2f4e9 (diff) |
leds: tca6507: 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: Riku Voipio <riku.voipio@iki.fi>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-leds@vger.kernel.org
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/leds/leds-tca6507.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c index 75529a24a615..c548ea10f0f0 100644 --- a/drivers/leds/leds-tca6507.c +++ b/drivers/leds/leds-tca6507.c | |||
@@ -603,7 +603,7 @@ static int tca6507_blink_set(struct led_classdev *led_cdev, | |||
603 | static void tca6507_gpio_set_value(struct gpio_chip *gc, | 603 | static void tca6507_gpio_set_value(struct gpio_chip *gc, |
604 | unsigned offset, int val) | 604 | unsigned offset, int val) |
605 | { | 605 | { |
606 | struct tca6507_chip *tca = container_of(gc, struct tca6507_chip, gpio); | 606 | struct tca6507_chip *tca = gpiochip_get_data(gc); |
607 | unsigned long flags; | 607 | unsigned long flags; |
608 | 608 | ||
609 | spin_lock_irqsave(&tca->lock, flags); | 609 | spin_lock_irqsave(&tca->lock, flags); |
@@ -655,7 +655,7 @@ static int tca6507_probe_gpios(struct i2c_client *client, | |||
655 | #ifdef CONFIG_OF_GPIO | 655 | #ifdef CONFIG_OF_GPIO |
656 | tca->gpio.of_node = of_node_get(client->dev.of_node); | 656 | tca->gpio.of_node = of_node_get(client->dev.of_node); |
657 | #endif | 657 | #endif |
658 | err = gpiochip_add(&tca->gpio); | 658 | err = gpiochip_add_data(&tca->gpio, tca); |
659 | if (err) { | 659 | if (err) { |
660 | tca->gpio.ngpio = 0; | 660 | tca->gpio.ngpio = 0; |
661 | return err; | 661 | return err; |