diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-03-25 03:53:42 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-03-25 03:53:42 -0300 |
commit | 03dd4cb26d967f9588437b0fc9cc0e8353322bb7 (patch) | |
tree | fa581f6dc1c0596391690d1f67eceef3af8246dc /drivers/pinctrl/bcm/pinctrl-bcm2835.c | |
parent | d4e493caf788ef44982e131ff9c786546904d934 (diff) |
Linux-libre 4.5-gnu
Diffstat (limited to 'drivers/pinctrl/bcm/pinctrl-bcm2835.c')
-rw-r--r-- | drivers/pinctrl/bcm/pinctrl-bcm2835.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 2e6ca6963..0f5997ceb 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -23,7 +23,7 @@ #include <linux/delay.h> #include <linux/device.h> #include <linux/err.h> -#include <linux/gpio.h> +#include <linux/gpio/driver.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/irq.h> @@ -337,14 +337,14 @@ static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset) static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); return bcm2835_gpio_get_bit(pc, GPLEV0, offset); } static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset); } @@ -358,7 +358,7 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip, static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); return irq_linear_revmap(pc->irq_domain, offset); } @@ -795,7 +795,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, return 0; out: - kfree(maps); + bcm2835_pctl_dt_free_map(pctldev, maps, num_pins * maps_per_pin); return err; } @@ -964,7 +964,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) return PTR_ERR(pc->base); pc->gpio_chip = bcm2835_gpio_chip; - pc->gpio_chip.dev = dev; + pc->gpio_chip.parent = dev; pc->gpio_chip.of_node = np; pc->irq_domain = irq_domain_add_linear(np, BCM2835_NUM_GPIOS, @@ -1021,7 +1021,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) } } - err = gpiochip_add(&pc->gpio_chip); + err = gpiochip_add_data(&pc->gpio_chip, pc); if (err) { dev_err(dev, "could not add GPIO chip\n"); return err; |