diff options
Diffstat (limited to 'drivers/pinctrl/sirf')
-rw-r--r-- | drivers/pinctrl/sirf/pinctrl-atlas7.c | 31 | ||||
-rw-r--r-- | drivers/pinctrl/sirf/pinctrl-sirf.c | 31 |
2 files changed, 26 insertions, 36 deletions
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c index 053d98e33944..beb024c31a5d 100644 --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c @@ -358,11 +358,6 @@ struct atlas7_gpio_chip { struct atlas7_gpio_bank banks[0]; }; -static inline struct atlas7_gpio_chip *to_atlas7_gpio(struct gpio_chip *gc) -{ - return container_of(gc, struct atlas7_gpio_chip, chip); -} - /** * @dev: a pointer back to containing device * @virtbase: the offset to the controller in virtual memory @@ -5642,7 +5637,7 @@ static int __atlas7_gpio_to_pin(struct atlas7_gpio_chip *a7gc, u32 gpio) static void atlas7_gpio_irq_ack(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc); struct atlas7_gpio_bank *bank; void __iomem *ctrl_reg; u32 val, pin_in_bank; @@ -5680,7 +5675,7 @@ static void __atlas7_gpio_irq_mask(struct atlas7_gpio_chip *a7gc, int idx) static void atlas7_gpio_irq_mask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc); unsigned long flags; spin_lock_irqsave(&a7gc->lock, flags); @@ -5693,7 +5688,7 @@ static void atlas7_gpio_irq_mask(struct irq_data *d) static void atlas7_gpio_irq_unmask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc); struct atlas7_gpio_bank *bank; void __iomem *ctrl_reg; u32 val, pin_in_bank; @@ -5717,7 +5712,7 @@ static int atlas7_gpio_irq_type(struct irq_data *d, unsigned int type) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc); struct atlas7_gpio_bank *bank; void __iomem *ctrl_reg; u32 val, pin_in_bank; @@ -5786,7 +5781,7 @@ static struct irq_chip atlas7_gpio_irq_chip = { static void atlas7_gpio_handle_irq(struct irq_desc *desc) { struct gpio_chip *gc = irq_desc_get_handler_data(desc); - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc); struct atlas7_gpio_bank *bank = NULL; u32 status, ctrl; int pin_in_bank = 0, idx; @@ -5854,7 +5849,7 @@ static void __atlas7_gpio_set_input(struct atlas7_gpio_chip *a7gc, static int atlas7_gpio_request(struct gpio_chip *chip, unsigned int gpio) { - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip); int ret; unsigned long flags; @@ -5882,7 +5877,7 @@ static int atlas7_gpio_request(struct gpio_chip *chip, static void atlas7_gpio_free(struct gpio_chip *chip, unsigned int gpio) { - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip); unsigned long flags; spin_lock_irqsave(&a7gc->lock, flags); @@ -5898,7 +5893,7 @@ static void atlas7_gpio_free(struct gpio_chip *chip, static int atlas7_gpio_direction_input(struct gpio_chip *chip, unsigned int gpio) { - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip); unsigned long flags; spin_lock_irqsave(&a7gc->lock, flags); @@ -5935,7 +5930,7 @@ static void __atlas7_gpio_set_output(struct atlas7_gpio_chip *a7gc, static int atlas7_gpio_direction_output(struct gpio_chip *chip, unsigned int gpio, int value) { - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip); unsigned long flags; spin_lock_irqsave(&a7gc->lock, flags); @@ -5950,7 +5945,7 @@ static int atlas7_gpio_direction_output(struct gpio_chip *chip, static int atlas7_gpio_get_value(struct gpio_chip *chip, unsigned int gpio) { - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip); struct atlas7_gpio_bank *bank; u32 val, pin_in_bank; unsigned long flags; @@ -5970,7 +5965,7 @@ static int atlas7_gpio_get_value(struct gpio_chip *chip, static void atlas7_gpio_set_value(struct gpio_chip *chip, unsigned int gpio, int value) { - struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip); + struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip); struct atlas7_gpio_bank *bank; void __iomem *ctrl_reg; u32 ctrl, pin_in_bank; @@ -6054,10 +6049,10 @@ static int atlas7_gpio_probe(struct platform_device *pdev) chip->label = kstrdup(np->name, GFP_KERNEL); chip->of_node = np; chip->of_gpio_n_cells = 2; - chip->dev = &pdev->dev; + chip->parent = &pdev->dev; /* Add gpio chip to system */ - ret = gpiochip_add(chip); + ret = gpiochip_add_data(chip, a7gc); if (ret) { dev_err(&pdev->dev, "%s: error in probe function with status %d\n", diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c index edf40df05ec0..762c0c9c1278 100644 --- a/drivers/pinctrl/sirf/pinctrl-sirf.c +++ b/drivers/pinctrl/sirf/pinctrl-sirf.c @@ -403,11 +403,6 @@ static int __init sirfsoc_pinmux_init(void) } arch_initcall(sirfsoc_pinmux_init); -static inline struct sirfsoc_gpio_chip *to_sirfsoc_gpio(struct gpio_chip *gc) -{ - return container_of(gc, struct sirfsoc_gpio_chip, chip.gc); -} - static inline struct sirfsoc_gpio_bank * sirfsoc_gpio_to_bank(struct sirfsoc_gpio_chip *sgpio, unsigned int offset) { @@ -422,7 +417,7 @@ static inline int sirfsoc_gpio_to_bankoff(unsigned int offset) static void sirfsoc_gpio_irq_ack(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(gc); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); int idx = sirfsoc_gpio_to_bankoff(d->hwirq); u32 val, offset; @@ -461,7 +456,7 @@ static void __sirfsoc_gpio_irq_mask(struct sirfsoc_gpio_chip *sgpio, static void sirfsoc_gpio_irq_mask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(gc); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); __sirfsoc_gpio_irq_mask(sgpio, bank, d->hwirq % SIRFSOC_GPIO_BANK_SIZE); @@ -470,7 +465,7 @@ static void sirfsoc_gpio_irq_mask(struct irq_data *d) static void sirfsoc_gpio_irq_unmask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(gc); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); int idx = sirfsoc_gpio_to_bankoff(d->hwirq); u32 val, offset; @@ -491,7 +486,7 @@ static void sirfsoc_gpio_irq_unmask(struct irq_data *d) static int sirfsoc_gpio_irq_type(struct irq_data *d, unsigned type) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(gc); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); int idx = sirfsoc_gpio_to_bankoff(d->hwirq); u32 val, offset; @@ -553,7 +548,7 @@ static void sirfsoc_gpio_handle_irq(struct irq_desc *desc) { unsigned int irq = irq_desc_get_irq(desc); struct gpio_chip *gc = irq_desc_get_handler_data(desc); - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(gc); struct sirfsoc_gpio_bank *bank; u32 status, ctrl; int idx = 0; @@ -611,7 +606,7 @@ static inline void sirfsoc_gpio_set_input(struct sirfsoc_gpio_chip *sgpio, static int sirfsoc_gpio_request(struct gpio_chip *chip, unsigned offset) { - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(chip); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); unsigned long flags; @@ -634,7 +629,7 @@ static int sirfsoc_gpio_request(struct gpio_chip *chip, unsigned offset) static void sirfsoc_gpio_free(struct gpio_chip *chip, unsigned offset) { - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(chip); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); unsigned long flags; @@ -650,7 +645,7 @@ static void sirfsoc_gpio_free(struct gpio_chip *chip, unsigned offset) static int sirfsoc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) { - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(chip); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, gpio); int idx = sirfsoc_gpio_to_bankoff(gpio); unsigned long flags; @@ -693,7 +688,7 @@ static inline void sirfsoc_gpio_set_output(struct sirfsoc_gpio_chip *sgpio, static int sirfsoc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int value) { - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(chip); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, gpio); int idx = sirfsoc_gpio_to_bankoff(gpio); u32 offset; @@ -712,7 +707,7 @@ static int sirfsoc_gpio_direction_output(struct gpio_chip *chip, static int sirfsoc_gpio_get_value(struct gpio_chip *chip, unsigned offset) { - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(chip); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); u32 val; unsigned long flags; @@ -729,7 +724,7 @@ static int sirfsoc_gpio_get_value(struct gpio_chip *chip, unsigned offset) static void sirfsoc_gpio_set_value(struct gpio_chip *chip, unsigned offset, int value) { - struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); + struct sirfsoc_gpio_chip *sgpio = gpiochip_get_data(chip); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); u32 ctrl; unsigned long flags; @@ -815,10 +810,10 @@ static int sirfsoc_gpio_probe(struct device_node *np) sgpio->chip.gc.of_node = np; sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; sgpio->chip.gc.of_gpio_n_cells = 2; - sgpio->chip.gc.dev = &pdev->dev; + sgpio->chip.gc.parent = &pdev->dev; sgpio->chip.regs = regs; - err = gpiochip_add(&sgpio->chip.gc); + err = gpiochip_add_data(&sgpio->chip.gc, sgpio); if (err) { dev_err(&pdev->dev, "%s: error in probe function with status %d\n", np->full_name, err); |