Commit 57371833 authored by Linus Walleij's avatar Linus Walleij

pinctrl: digicolor: 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().
Acked-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 014c1b3d
...@@ -171,7 +171,7 @@ static struct pinmux_ops dc_pmxops = { ...@@ -171,7 +171,7 @@ static struct pinmux_ops dc_pmxops = {
static int dc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) static int dc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
{ {
struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); struct dc_pinmap *pmap = gpiochip_get_data(chip);
int reg_off = GP_DRIVE0(gpio/PINS_PER_COLLECTION); int reg_off = GP_DRIVE0(gpio/PINS_PER_COLLECTION);
int bit_off = gpio % PINS_PER_COLLECTION; int bit_off = gpio % PINS_PER_COLLECTION;
u8 drive; u8 drive;
...@@ -191,7 +191,7 @@ static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value); ...@@ -191,7 +191,7 @@ static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value);
static int dc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, static int dc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
int value) int value)
{ {
struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); struct dc_pinmap *pmap = gpiochip_get_data(chip);
int reg_off = GP_DRIVE0(gpio/PINS_PER_COLLECTION); int reg_off = GP_DRIVE0(gpio/PINS_PER_COLLECTION);
int bit_off = gpio % PINS_PER_COLLECTION; int bit_off = gpio % PINS_PER_COLLECTION;
u8 drive; u8 drive;
...@@ -210,7 +210,7 @@ static int dc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, ...@@ -210,7 +210,7 @@ static int dc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
static int dc_gpio_get(struct gpio_chip *chip, unsigned gpio) static int dc_gpio_get(struct gpio_chip *chip, unsigned gpio)
{ {
struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); struct dc_pinmap *pmap = gpiochip_get_data(chip);
int reg_off = GP_INPUT(gpio/PINS_PER_COLLECTION); int reg_off = GP_INPUT(gpio/PINS_PER_COLLECTION);
int bit_off = gpio % PINS_PER_COLLECTION; int bit_off = gpio % PINS_PER_COLLECTION;
u8 input; u8 input;
...@@ -222,7 +222,7 @@ static int dc_gpio_get(struct gpio_chip *chip, unsigned gpio) ...@@ -222,7 +222,7 @@ static int dc_gpio_get(struct gpio_chip *chip, unsigned gpio)
static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value)
{ {
struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); struct dc_pinmap *pmap = gpiochip_get_data(chip);
int reg_off = GP_OUTPUT0(gpio/PINS_PER_COLLECTION); int reg_off = GP_OUTPUT0(gpio/PINS_PER_COLLECTION);
int bit_off = gpio % PINS_PER_COLLECTION; int bit_off = gpio % PINS_PER_COLLECTION;
u8 output; u8 output;
...@@ -258,7 +258,7 @@ static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np) ...@@ -258,7 +258,7 @@ static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np)
spin_lock_init(&pmap->lock); spin_lock_init(&pmap->lock);
ret = gpiochip_add(chip); ret = gpiochip_add_data(chip, pmap);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment