diff options
Diffstat (limited to 'drivers/gpio/gpio-clps711x.c')
-rw-r--r-- | drivers/gpio/gpio-clps711x.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpio/gpio-clps711x.c b/drivers/gpio/gpio-clps711x.c index b6908f1ff..c84f9551f 100644 --- a/drivers/gpio/gpio-clps711x.c +++ b/drivers/gpio/gpio-clps711x.c @@ -10,24 +10,23 @@ */ #include <linux/err.h> -#include <linux/gpio.h> #include <linux/module.h> -#include <linux/basic_mmio_gpio.h> +#include <linux/gpio/driver.h> #include <linux/platform_device.h> static int clps711x_gpio_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; void __iomem *dat, *dir; - struct bgpio_chip *bgc; + struct gpio_chip *gc; struct resource *res; int err, id = np ? of_alias_get_id(np, "gpio") : pdev->id; if ((id < 0) || (id > 4)) return -ENODEV; - bgc = devm_kzalloc(&pdev->dev, sizeof(*bgc), GFP_KERNEL); - if (!bgc) + gc = devm_kzalloc(&pdev->dev, sizeof(*gc), GFP_KERNEL); + if (!gc) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -43,11 +42,11 @@ static int clps711x_gpio_probe(struct platform_device *pdev) switch (id) { case 3: /* PORTD is inverted logic for direction register */ - err = bgpio_init(bgc, &pdev->dev, 1, dat, NULL, NULL, + err = bgpio_init(gc, &pdev->dev, 1, dat, NULL, NULL, NULL, dir, 0); break; default: - err = bgpio_init(bgc, &pdev->dev, 1, dat, NULL, NULL, + err = bgpio_init(gc, &pdev->dev, 1, dat, NULL, NULL, dir, NULL, 0); break; } @@ -58,24 +57,25 @@ static int clps711x_gpio_probe(struct platform_device *pdev) switch (id) { case 4: /* PORTE is 3 lines only */ - bgc->gc.ngpio = 3; + gc->ngpio = 3; break; default: break; } - bgc->gc.base = id * 8; - bgc->gc.owner = THIS_MODULE; - platform_set_drvdata(pdev, bgc); + gc->base = id * 8; + gc->owner = THIS_MODULE; + platform_set_drvdata(pdev, gc); - return gpiochip_add(&bgc->gc); + return gpiochip_add_data(gc, NULL); } static int clps711x_gpio_remove(struct platform_device *pdev) { - struct bgpio_chip *bgc = platform_get_drvdata(pdev); + struct gpio_chip *gc = platform_get_drvdata(pdev); - return bgpio_remove(bgc); + gpiochip_remove(gc); + return 0; } static const struct of_device_id __maybe_unused clps711x_gpio_ids[] = { |