diff options
author | Mark Brown <broonie@kernel.org> | 2016-02-09 21:20:39 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-09 21:20:39 +0300 |
commit | fcdcc79628a1919bde9acf239e364f65bab6327c (patch) | |
tree | 5499be387cf3028c90ac083b1cf866ebed7bf7e0 /drivers/gpio/gpio-ml-ioh.c | |
parent | 7a8d44bc89e5cddcd5c0704a11a90484d36ba6ba (diff) | |
parent | a0a90718f18264dc904d34a580f332006f5561e9 (diff) | |
download | linux-fcdcc79628a1919bde9acf239e364f65bab6327c.tar.xz |
Merge branch 'topic/acpi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-pxa2xx
Diffstat (limited to 'drivers/gpio/gpio-ml-ioh.c')
-rw-r--r-- | drivers/gpio/gpio-ml-ioh.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c index 5536108aa9db..796a5a4bc4f5 100644 --- a/drivers/gpio/gpio-ml-ioh.c +++ b/drivers/gpio/gpio-ml-ioh.c @@ -106,7 +106,7 @@ static const int num_ports[] = {6, 12, 16, 16, 15, 16, 16, 12}; static void ioh_gpio_set(struct gpio_chip *gpio, unsigned nr, int val) { u32 reg_val; - struct ioh_gpio *chip = container_of(gpio, struct ioh_gpio, gpio); + struct ioh_gpio *chip = gpiochip_get_data(gpio); unsigned long flags; spin_lock_irqsave(&chip->spinlock, flags); @@ -122,15 +122,15 @@ static void ioh_gpio_set(struct gpio_chip *gpio, unsigned nr, int val) static int ioh_gpio_get(struct gpio_chip *gpio, unsigned nr) { - struct ioh_gpio *chip = container_of(gpio, struct ioh_gpio, gpio); + struct ioh_gpio *chip = gpiochip_get_data(gpio); - return ioread32(&chip->reg->regs[chip->ch].pi) & (1 << nr); + return !!(ioread32(&chip->reg->regs[chip->ch].pi) & (1 << nr)); } static int ioh_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, int val) { - struct ioh_gpio *chip = container_of(gpio, struct ioh_gpio, gpio); + struct ioh_gpio *chip = gpiochip_get_data(gpio); u32 pm; u32 reg_val; unsigned long flags; @@ -155,7 +155,7 @@ static int ioh_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, static int ioh_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) { - struct ioh_gpio *chip = container_of(gpio, struct ioh_gpio, gpio); + struct ioh_gpio *chip = gpiochip_get_data(gpio); u32 pm; unsigned long flags; @@ -225,7 +225,7 @@ static void ioh_gpio_restore_reg_conf(struct ioh_gpio *chip) static int ioh_gpio_to_irq(struct gpio_chip *gpio, unsigned offset) { - struct ioh_gpio *chip = container_of(gpio, struct ioh_gpio, gpio); + struct ioh_gpio *chip = gpiochip_get_data(gpio); return chip->irq_base + offset; } @@ -450,7 +450,7 @@ static int ioh_gpio_probe(struct pci_dev *pdev, chip->ch = i; spin_lock_init(&chip->spinlock); ioh_gpio_setup(chip, num_ports[i]); - ret = gpiochip_add(&chip->gpio); + ret = gpiochip_add_data(&chip->gpio, chip); if (ret) { dev_err(&pdev->dev, "IOH gpio: Failed to register GPIO\n"); goto err_gpiochip_add; |