* Re: [PATCH 157/182] input: ad7879: use gpiochip data pointer
2015-12-09 13:45 [PATCH 157/182] input: ad7879: use gpiochip data pointer Linus Walleij
@ 2015-12-09 13:43 ` Michael Hennerich
2015-12-16 22:08 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Michael Hennerich @ 2015-12-09 13:43 UTC (permalink / raw)
To: Linus Walleij, linux-gpio, Johan Hovold, Alexandre Courbot,
Michael Welling, Markus Pargmann, Dmitry Torokhov
On 12/09/2015 02:45 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: Michael Hennerich <michael.hennerich@analog.com>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
> Dmitry: please ACK this so I can take it through the GPIO tree.
> ---
> drivers/input/touchscreen/ad7879.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
> index 16b5cc2196f2..583a0590ceb2 100644
> --- a/drivers/input/touchscreen/ad7879.c
> +++ b/drivers/input/touchscreen/ad7879.c
> @@ -379,7 +379,7 @@ static const struct attribute_group ad7879_attr_group = {
> static int ad7879_gpio_direction_input(struct gpio_chip *chip,
> unsigned gpio)
> {
> - struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> + struct ad7879 *ts = gpiochip_get_data(chip);
> int err;
>
> mutex_lock(&ts->mutex);
> @@ -393,7 +393,7 @@ static int ad7879_gpio_direction_input(struct gpio_chip *chip,
> static int ad7879_gpio_direction_output(struct gpio_chip *chip,
> unsigned gpio, int level)
> {
> - struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> + struct ad7879 *ts = gpiochip_get_data(chip);
> int err;
>
> mutex_lock(&ts->mutex);
> @@ -412,7 +412,7 @@ static int ad7879_gpio_direction_output(struct gpio_chip *chip,
>
> static int ad7879_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
> {
> - struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> + struct ad7879 *ts = gpiochip_get_data(chip);
> u16 val;
>
> mutex_lock(&ts->mutex);
> @@ -425,7 +425,7 @@ static int ad7879_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
> static void ad7879_gpio_set_value(struct gpio_chip *chip,
> unsigned gpio, int value)
> {
> - struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> + struct ad7879 *ts = gpiochip_get_data(chip);
>
> mutex_lock(&ts->mutex);
> if (value)
> @@ -456,7 +456,7 @@ static int ad7879_gpio_add(struct ad7879 *ts,
> ts->gc.owner = THIS_MODULE;
> ts->gc.parent = ts->dev;
>
> - ret = gpiochip_add(&ts->gc);
> + ret = gpiochip_add_data(&ts->gc, ts);
> if (ret)
> dev_err(ts->dev, "failed to register gpio %d\n",
> ts->gc.base);
>
--
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 157/182] input: ad7879: use gpiochip data pointer
@ 2015-12-09 13:45 Linus Walleij
2015-12-09 13:43 ` Michael Hennerich
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2015-12-09 13:45 UTC (permalink / raw)
To: linux-gpio, Johan Hovold, Alexandre Courbot, Michael Welling,
Markus Pargmann, Michael Hennerich, Dmitry Torokhov
Cc: Linus Walleij
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 Hennerich <michael.hennerich@analog.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Dmitry: please ACK this so I can take it through the GPIO tree.
---
drivers/input/touchscreen/ad7879.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index 16b5cc2196f2..583a0590ceb2 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -379,7 +379,7 @@ static const struct attribute_group ad7879_attr_group = {
static int ad7879_gpio_direction_input(struct gpio_chip *chip,
unsigned gpio)
{
- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
+ struct ad7879 *ts = gpiochip_get_data(chip);
int err;
mutex_lock(&ts->mutex);
@@ -393,7 +393,7 @@ static int ad7879_gpio_direction_input(struct gpio_chip *chip,
static int ad7879_gpio_direction_output(struct gpio_chip *chip,
unsigned gpio, int level)
{
- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
+ struct ad7879 *ts = gpiochip_get_data(chip);
int err;
mutex_lock(&ts->mutex);
@@ -412,7 +412,7 @@ static int ad7879_gpio_direction_output(struct gpio_chip *chip,
static int ad7879_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
{
- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
+ struct ad7879 *ts = gpiochip_get_data(chip);
u16 val;
mutex_lock(&ts->mutex);
@@ -425,7 +425,7 @@ static int ad7879_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
static void ad7879_gpio_set_value(struct gpio_chip *chip,
unsigned gpio, int value)
{
- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
+ struct ad7879 *ts = gpiochip_get_data(chip);
mutex_lock(&ts->mutex);
if (value)
@@ -456,7 +456,7 @@ static int ad7879_gpio_add(struct ad7879 *ts,
ts->gc.owner = THIS_MODULE;
ts->gc.parent = ts->dev;
- ret = gpiochip_add(&ts->gc);
+ ret = gpiochip_add_data(&ts->gc, ts);
if (ret)
dev_err(ts->dev, "failed to register gpio %d\n",
ts->gc.base);
--
2.4.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 157/182] input: ad7879: use gpiochip data pointer
2015-12-09 13:43 ` Michael Hennerich
@ 2015-12-16 22:08 ` Dmitry Torokhov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2015-12-16 22:08 UTC (permalink / raw)
To: Michael Hennerich
Cc: Linus Walleij, linux-gpio, Johan Hovold, Alexandre Courbot,
Michael Welling, Markus Pargmann
On Wed, Dec 09, 2015 at 02:43:43PM +0100, Michael Hennerich wrote:
> On 12/09/2015 02:45 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: Michael Hennerich <michael.hennerich@analog.com>
> >Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
>
> >---
> >Dmitry: please ACK this so I can take it through the GPIO tree.
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >---
> > drivers/input/touchscreen/ad7879.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> >diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
> >index 16b5cc2196f2..583a0590ceb2 100644
> >--- a/drivers/input/touchscreen/ad7879.c
> >+++ b/drivers/input/touchscreen/ad7879.c
> >@@ -379,7 +379,7 @@ static const struct attribute_group ad7879_attr_group = {
> > static int ad7879_gpio_direction_input(struct gpio_chip *chip,
> > unsigned gpio)
> > {
> >- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> >+ struct ad7879 *ts = gpiochip_get_data(chip);
> > int err;
> >
> > mutex_lock(&ts->mutex);
> >@@ -393,7 +393,7 @@ static int ad7879_gpio_direction_input(struct gpio_chip *chip,
> > static int ad7879_gpio_direction_output(struct gpio_chip *chip,
> > unsigned gpio, int level)
> > {
> >- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> >+ struct ad7879 *ts = gpiochip_get_data(chip);
> > int err;
> >
> > mutex_lock(&ts->mutex);
> >@@ -412,7 +412,7 @@ static int ad7879_gpio_direction_output(struct gpio_chip *chip,
> >
> > static int ad7879_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
> > {
> >- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> >+ struct ad7879 *ts = gpiochip_get_data(chip);
> > u16 val;
> >
> > mutex_lock(&ts->mutex);
> >@@ -425,7 +425,7 @@ static int ad7879_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
> > static void ad7879_gpio_set_value(struct gpio_chip *chip,
> > unsigned gpio, int value)
> > {
> >- struct ad7879 *ts = container_of(chip, struct ad7879, gc);
> >+ struct ad7879 *ts = gpiochip_get_data(chip);
> >
> > mutex_lock(&ts->mutex);
> > if (value)
> >@@ -456,7 +456,7 @@ static int ad7879_gpio_add(struct ad7879 *ts,
> > ts->gc.owner = THIS_MODULE;
> > ts->gc.parent = ts->dev;
> >
> >- ret = gpiochip_add(&ts->gc);
> >+ ret = gpiochip_add_data(&ts->gc, ts);
> > if (ret)
> > dev_err(ts->dev, "failed to register gpio %d\n",
> > ts->gc.base);
> >
>
>
> --
> Greetings,
> Michael
>
> --
> Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
> Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
> Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
> Margaret Seif
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-16 22:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 13:45 [PATCH 157/182] input: ad7879: use gpiochip data pointer Linus Walleij
2015-12-09 13:43 ` Michael Hennerich
2015-12-16 22:08 ` Dmitry Torokhov
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.