diff options
Diffstat (limited to 'drivers/gpio/gpio-zevio.c')
-rw-r--r-- | drivers/gpio/gpio-zevio.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-zevio.c b/drivers/gpio/gpio-zevio.c index 6f02d7c4cc57..cda6d922be98 100644 --- a/drivers/gpio/gpio-zevio.c +++ b/drivers/gpio/gpio-zevio.c @@ -52,9 +52,6 @@ #define ZEVIO_GPIO_INPUT 0x18 #define ZEVIO_GPIO_INT_STICKY 0x20 -#define to_zevio_gpio(chip) container_of(to_of_mm_gpio_chip(chip), \ - struct zevio_gpio, chip) - /* Bit number of GPIO in its section */ #define ZEVIO_GPIO_BIT(gpio) (gpio&7) @@ -80,7 +77,7 @@ static inline void zevio_gpio_port_set(struct zevio_gpio *c, unsigned pin, /* Functions for struct gpio_chip */ static int zevio_gpio_get(struct gpio_chip *chip, unsigned pin) { - struct zevio_gpio *controller = to_zevio_gpio(chip); + struct zevio_gpio *controller = gpiochip_get_data(chip); u32 val, dir; spin_lock(&controller->lock); @@ -96,7 +93,7 @@ static int zevio_gpio_get(struct gpio_chip *chip, unsigned pin) static void zevio_gpio_set(struct gpio_chip *chip, unsigned pin, int value) { - struct zevio_gpio *controller = to_zevio_gpio(chip); + struct zevio_gpio *controller = gpiochip_get_data(chip); u32 val; spin_lock(&controller->lock); @@ -112,7 +109,7 @@ static void zevio_gpio_set(struct gpio_chip *chip, unsigned pin, int value) static int zevio_gpio_direction_input(struct gpio_chip *chip, unsigned pin) { - struct zevio_gpio *controller = to_zevio_gpio(chip); + struct zevio_gpio *controller = gpiochip_get_data(chip); u32 val; spin_lock(&controller->lock); @@ -129,7 +126,7 @@ static int zevio_gpio_direction_input(struct gpio_chip *chip, unsigned pin) static int zevio_gpio_direction_output(struct gpio_chip *chip, unsigned pin, int value) { - struct zevio_gpio *controller = to_zevio_gpio(chip); + struct zevio_gpio *controller = gpiochip_get_data(chip); u32 val; spin_lock(&controller->lock); @@ -185,9 +182,11 @@ static int zevio_gpio_probe(struct platform_device *pdev) /* Copy our reference */ controller->chip.gc = zevio_gpio_chip; - controller->chip.gc.dev = &pdev->dev; + controller->chip.gc.parent = &pdev->dev; - status = of_mm_gpiochip_add(pdev->dev.of_node, &(controller->chip)); + status = of_mm_gpiochip_add_data(pdev->dev.of_node, + &(controller->chip), + controller); if (status) { dev_err(&pdev->dev, "failed to add gpiochip: %d\n", status); return status; @@ -199,7 +198,7 @@ static int zevio_gpio_probe(struct platform_device *pdev) for (i = 0; i < controller->chip.gc.ngpio; i += 8) zevio_gpio_port_set(controller, i, ZEVIO_GPIO_INT_MASK, 0xFF); - dev_dbg(controller->chip.gc.dev, "ZEVIO GPIO controller set up!\n"); + dev_dbg(controller->chip.gc.parent, "ZEVIO GPIO controller set up!\n"); return 0; } |