aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-02-12 03:22:11 -0500
committerLinus Walleij <linus.walleij@linaro.org>2016-02-15 18:19:54 -0500
commit4e6fd26dcf5d70a7700a4c15d8f239103bdce91d (patch)
tree8e86749506bdcea2a07243f7e4efaaf462ce865e
parent148ad68b3d0dd0f0068ff5f6f47bc360011c429e (diff)
pinctrl: sirf/atlas7: stop poking around in GPIO internals
This code is poking around in the gpio_chip:s internal structures to achieve some kind of pin to GPIO mappings. - It is wrong to poke around in these structs and the pinctrl maintainer was stupid to let it pass unnoticed, mea culpa. - The right interface to use is gpiochip_add_pin_range() - The code appears unused: the pin control part of the driver is not adding any ranges, so we're iterating over an empty list. Maybe it is poking around in some other pin controllers GPIO ranges, and that's just totally wrong, again use gpiochip_add_pin_range() and specify the right pin controller. Cc: Barry Song <baohua@kernel.org> Cc: Guoying Zhang <Guoying.Zhang@csr.com> Cc: Wei Chen <Wei.Chen@csr.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/sirf/pinctrl-atlas7.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
index beb024c31a5d..3d233fc3448a 100644
--- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
+++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
@@ -338,7 +338,6 @@ struct atlas7_pinctrl_data {
338#define ATLAS7_GPIO_CTL_DATAIN_MASK BIT(7) 338#define ATLAS7_GPIO_CTL_DATAIN_MASK BIT(7)
339 339
340struct atlas7_gpio_bank { 340struct atlas7_gpio_bank {
341 struct pinctrl_dev *pctldev;
342 int id; 341 int id;
343 int irq; 342 int irq;
344 void __iomem *base; 343 void __iomem *base;
@@ -6070,7 +6069,6 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
6070 } 6069 }
6071 6070
6072 for (idx = 0; idx < nbank; idx++) { 6071 for (idx = 0; idx < nbank; idx++) {
6073 struct gpio_pin_range *pin_range;
6074 struct atlas7_gpio_bank *bank; 6072 struct atlas7_gpio_bank *bank;
6075 6073
6076 bank = &a7gc->banks[idx]; 6074 bank = &a7gc->banks[idx];
@@ -6088,22 +6086,6 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
6088 6086
6089 gpiochip_set_chained_irqchip(chip, &atlas7_gpio_irq_chip, 6087 gpiochip_set_chained_irqchip(chip, &atlas7_gpio_irq_chip,
6090 bank->irq, atlas7_gpio_handle_irq); 6088 bank->irq, atlas7_gpio_handle_irq);
6091
6092 /* Records gpio_pin_range to a7gc */
6093 list_for_each_entry(pin_range, &chip->pin_ranges, node) {
6094 struct pinctrl_gpio_range *range;
6095
6096 range = &pin_range->range;
6097 if (range->id == NGPIO_OF_BANK * idx) {
6098 bank->gpio_offset = range->id;
6099 bank->ngpio = range->npins;
6100 bank->gpio_pins = range->pins;
6101 bank->pctldev = pin_range->pctldev;
6102 break;
6103 }
6104 }
6105
6106 BUG_ON(!bank->pctldev);
6107 } 6089 }
6108 6090
6109 platform_set_drvdata(pdev, a7gc); 6091 platform_set_drvdata(pdev, a7gc);