diff options
| author | Mark Brown <[email protected]> | 2016-02-09 18:20:39 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2016-02-09 18:20:39 +0000 |
| commit | fcdcc79628a1919bde9acf239e364f65bab6327c (patch) | |
| tree | 5499be387cf3028c90ac083b1cf866ebed7bf7e0 /drivers/gpio/gpio-xgene.c | |
| parent | 7a8d44bc89e5cddcd5c0704a11a90484d36ba6ba (diff) | |
| parent | a0a90718f18264dc904d34a580f332006f5561e9 (diff) | |
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-xgene.c')
| -rw-r--r-- | drivers/gpio/gpio-xgene.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c index 18a8182d4fec..592e9cdf9c53 100644 --- a/drivers/gpio/gpio-xgene.c +++ b/drivers/gpio/gpio-xgene.c @@ -47,14 +47,9 @@ struct xgene_gpio { #endif }; -static inline struct xgene_gpio *to_xgene_gpio(struct gpio_chip *chip) -{ - return container_of(chip, struct xgene_gpio, chip); -} - static int xgene_gpio_get(struct gpio_chip *gc, unsigned int offset) { - struct xgene_gpio *chip = to_xgene_gpio(gc); + struct xgene_gpio *chip = gpiochip_get_data(gc); unsigned long bank_offset; u32 bit_offset; @@ -65,7 +60,7 @@ static int xgene_gpio_get(struct gpio_chip *gc, unsigned int offset) static void __xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val) { - struct xgene_gpio *chip = to_xgene_gpio(gc); + struct xgene_gpio *chip = gpiochip_get_data(gc); unsigned long bank_offset; u32 setval, bit_offset; @@ -82,7 +77,7 @@ static void __xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val) static void xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val) { - struct xgene_gpio *chip = to_xgene_gpio(gc); + struct xgene_gpio *chip = gpiochip_get_data(gc); unsigned long flags; spin_lock_irqsave(&chip->lock, flags); @@ -92,7 +87,7 @@ static void xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val) static int xgene_gpio_dir_in(struct gpio_chip *gc, unsigned int offset) { - struct xgene_gpio *chip = to_xgene_gpio(gc); + struct xgene_gpio *chip = gpiochip_get_data(gc); unsigned long flags, bank_offset; u32 dirval, bit_offset; @@ -113,7 +108,7 @@ static int xgene_gpio_dir_in(struct gpio_chip *gc, unsigned int offset) static int xgene_gpio_dir_out(struct gpio_chip *gc, unsigned int offset, int val) { - struct xgene_gpio *chip = to_xgene_gpio(gc); + struct xgene_gpio *chip = gpiochip_get_data(gc); unsigned long flags, bank_offset; u32 dirval, bit_offset; @@ -188,7 +183,7 @@ static int xgene_gpio_probe(struct platform_device *pdev) gpio->chip.ngpio = XGENE_MAX_GPIOS; spin_lock_init(&gpio->lock); - gpio->chip.dev = &pdev->dev; + gpio->chip.parent = &pdev->dev; gpio->chip.direction_input = xgene_gpio_dir_in; gpio->chip.direction_output = xgene_gpio_dir_out; gpio->chip.get = xgene_gpio_get; @@ -198,7 +193,7 @@ static int xgene_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gpio); - err = gpiochip_add(&gpio->chip); + err = gpiochip_add_data(&gpio->chip, gpio); if (err) { dev_err(&pdev->dev, "failed to register gpiochip.\n"); |