summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-pcf857x.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-07 11:24:05 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-01-05 11:21:11 +0100
commit597358e41070e03479a7724b16eb3c6c7ea50027 (patch)
treea187fd1be12347595a96155c422329d9d56ddda2 /drivers/gpio/gpio-pcf857x.c
parent468e67f6eb7494e3c4d4d644f281d0ba0cc265c6 (diff)
downloadtalos-obmc-linux-597358e41070e03479a7724b16eb3c6c7ea50027.tar.gz
talos-obmc-linux-597358e41070e03479a7724b16eb3c6c7ea50027.zip
gpio: pcf857x: 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: Grygorii Strashko <grygorii.strashko@ti.com> Cc: George Cherian <george.cherian@ti.com> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-pcf857x.c')
-rw-r--r--drivers/gpio/gpio-pcf857x.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c
index f64380a7d004..709cd3fc2a70 100644
--- a/drivers/gpio/gpio-pcf857x.c
+++ b/drivers/gpio/gpio-pcf857x.c
@@ -137,7 +137,7 @@ static int i2c_read_le16(struct i2c_client *client)
static int pcf857x_input(struct gpio_chip *chip, unsigned offset)
{
- struct pcf857x *gpio = container_of(chip, struct pcf857x, chip);
+ struct pcf857x *gpio = gpiochip_get_data(chip);
int status;
mutex_lock(&gpio->lock);
@@ -150,7 +150,7 @@ static int pcf857x_input(struct gpio_chip *chip, unsigned offset)
static int pcf857x_get(struct gpio_chip *chip, unsigned offset)
{
- struct pcf857x *gpio = container_of(chip, struct pcf857x, chip);
+ struct pcf857x *gpio = gpiochip_get_data(chip);
int value;
value = gpio->read(gpio->client);
@@ -159,7 +159,7 @@ static int pcf857x_get(struct gpio_chip *chip, unsigned offset)
static int pcf857x_output(struct gpio_chip *chip, unsigned offset, int value)
{
- struct pcf857x *gpio = container_of(chip, struct pcf857x, chip);
+ struct pcf857x *gpio = gpiochip_get_data(chip);
unsigned bit = 1 << offset;
int status;
@@ -372,7 +372,7 @@ static int pcf857x_probe(struct i2c_client *client,
gpio->out = ~n_latch;
gpio->status = gpio->out;
- status = gpiochip_add(&gpio->chip);
+ status = gpiochip_add_data(&gpio->chip, gpio);
if (status < 0)
goto fail;
OpenPOWER on IntegriCloud