All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 159/182] leds: tca6507: use gpiochip data pointer
@ 2015-12-09 13:46 Linus Walleij
  2015-12-09 14:29 ` Jacek Anaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2015-12-09 13:46 UTC (permalink / raw)
  To: linux-gpio, Johan Hovold, Alexandre Courbot, Michael Welling,
	Markus Pargmann, Riku Voipio, Richard Purdie, Jacek Anaszewski
  Cc: Linus Walleij, linux-leds

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: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: linux-leds@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
LEDS people: please ACK this so I can merge it in the GPIO tree.
---
 drivers/leds/leds-tca6507.c | 4 ++--
 1 file 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,
 static void tca6507_gpio_set_value(struct gpio_chip *gc,
 				   unsigned offset, int val)
 {
-	struct tca6507_chip *tca = container_of(gc, struct tca6507_chip, gpio);
+	struct tca6507_chip *tca = gpiochip_get_data(gc);
 	unsigned long flags;
 
 	spin_lock_irqsave(&tca->lock, flags);
@@ -655,7 +655,7 @@ static int tca6507_probe_gpios(struct i2c_client *client,
 #ifdef CONFIG_OF_GPIO
 	tca->gpio.of_node = of_node_get(client->dev.of_node);
 #endif
-	err = gpiochip_add(&tca->gpio);
+	err = gpiochip_add_data(&tca->gpio, tca);
 	if (err) {
 		tca->gpio.ngpio = 0;
 		return err;
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 159/182] leds: tca6507: use gpiochip data pointer
  2015-12-09 13:46 [PATCH 159/182] leds: tca6507: use gpiochip data pointer Linus Walleij
@ 2015-12-09 14:29 ` Jacek Anaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2015-12-09 14:29 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-gpio, Johan Hovold, Alexandre Courbot, Michael Welling,
	Markus Pargmann, Riku Voipio, Richard Purdie, linux-leds

On 12/09/2015 02:46 PM, Linus Walleij wrote:
> 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: Jacek Anaszewski <j.anaszewski@samsung.com>
> Cc: linux-leds@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> LEDS people: please ACK this so I can merge it in the GPIO tree.
> ---
>   drivers/leds/leds-tca6507.c | 4 ++--
>   1 file 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,
>   static void tca6507_gpio_set_value(struct gpio_chip *gc,
>   				   unsigned offset, int val)
>   {
> -	struct tca6507_chip *tca = container_of(gc, struct tca6507_chip, gpio);
> +	struct tca6507_chip *tca = gpiochip_get_data(gc);
>   	unsigned long flags;
>
>   	spin_lock_irqsave(&tca->lock, flags);
> @@ -655,7 +655,7 @@ static int tca6507_probe_gpios(struct i2c_client *client,
>   #ifdef CONFIG_OF_GPIO
>   	tca->gpio.of_node = of_node_get(client->dev.of_node);
>   #endif
> -	err = gpiochip_add(&tca->gpio);
> +	err = gpiochip_add_data(&tca->gpio, tca);
>   	if (err) {
>   		tca->gpio.ngpio = 0;
>   		return err;
>

Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>

-- 
Best Regards,
Jacek Anaszewski

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-09 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-09 13:46 [PATCH 159/182] leds: tca6507: use gpiochip data pointer Linus Walleij
2015-12-09 14:29 ` Jacek Anaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.