diff options
Diffstat (limited to 'drivers/gpio/gpio-janz-ttl.c')
-rw-r--r-- | drivers/gpio/gpio-janz-ttl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c index 3a1664335f5e..482aa0353868 100644 --- a/drivers/gpio/gpio-janz-ttl.c +++ b/drivers/gpio/gpio-janz-ttl.c @@ -59,7 +59,7 @@ struct ttl_module { static int ttl_get_value(struct gpio_chip *gpio, unsigned offset) { - struct ttl_module *mod = dev_get_drvdata(gpio->dev); + struct ttl_module *mod = dev_get_drvdata(gpio->parent); u8 *shadow; int ret; @@ -76,12 +76,12 @@ static int ttl_get_value(struct gpio_chip *gpio, unsigned offset) spin_lock(&mod->lock); ret = *shadow & (1 << offset); spin_unlock(&mod->lock); - return ret; + return !!ret; } static void ttl_set_value(struct gpio_chip *gpio, unsigned offset, int value) { - struct ttl_module *mod = dev_get_drvdata(gpio->dev); + struct ttl_module *mod = dev_get_drvdata(gpio->parent); void __iomem *port; u8 *shadow; @@ -172,7 +172,7 @@ static int ttl_probe(struct platform_device *pdev) /* Initialize the GPIO data structures */ gpio = &mod->gpio; - gpio->dev = &pdev->dev; + gpio->parent = &pdev->dev; gpio->label = pdev->name; gpio->get = ttl_get_value; gpio->set = ttl_set_value; @@ -182,7 +182,7 @@ static int ttl_probe(struct platform_device *pdev) gpio->base = -1; gpio->ngpio = 20; - ret = gpiochip_add(gpio); + ret = gpiochip_add_data(gpio, NULL); if (ret) { dev_err(dev, "unable to add GPIO chip\n"); return ret; |