diff options
Diffstat (limited to 'drivers/gpio/gpio-msic.c')
-rw-r--r-- | drivers/gpio/gpio-msic.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c index 22523aae8..d75649787 100644 --- a/drivers/gpio/gpio-msic.c +++ b/drivers/gpio/gpio-msic.c @@ -143,7 +143,7 @@ static int msic_gpio_get(struct gpio_chip *chip, unsigned offset) if (ret < 0) return ret; - return r & MSIC_GPIO_DIN_MASK; + return !!(r & MSIC_GPIO_DIN_MASK); } static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value) @@ -179,7 +179,7 @@ static int msic_irq_type(struct irq_data *data, unsigned type) static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct msic_gpio *mg = container_of(chip, struct msic_gpio, chip); + struct msic_gpio *mg = gpiochip_get_data(chip); return mg->irq_base + offset; } @@ -293,11 +293,11 @@ static int platform_msic_gpio_probe(struct platform_device *pdev) mg->chip.base = pdata->gpio_base; mg->chip.ngpio = MSIC_NUM_GPIO; mg->chip.can_sleep = true; - mg->chip.dev = dev; + mg->chip.parent = dev; mutex_init(&mg->buslock); - retval = gpiochip_add(&mg->chip); + retval = gpiochip_add_data(&mg->chip, mg); if (retval) { dev_err(dev, "Adding MSIC gpio chip failed\n"); goto err; |