diff options
author | Sergio Paracuellos <sergio.paracuellos@gmail.com> | 2020-12-06 11:53:33 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-07 15:10:16 +0100 |
commit | 94168e2ba4dc6a8db033afcd32ad64ab8ec9f09c (patch) | |
tree | d8d1845011eba7705551167d89931caab2922212 /drivers/staging/mt7621-pinctrl | |
parent | 6c7b8ac995d9960b8a7238c10fd1d449f0157da1 (diff) | |
download | linux-94168e2ba4dc6a8db033afcd32ad64ab8ec9f09c.tar.gz linux-94168e2ba4dc6a8db033afcd32ad64ab8ec9f09c.tar.bz2 linux-94168e2ba4dc6a8db033afcd32ad64ab8ec9f09c.zip |
staging: mt7621-pinctrl: stop using the deprecated 'pinctrl_add_gpio_range'
If the gpio DT node has the 'gpio-ranges' property, the range will be
added by the gpio core and doesn't need to be added by the pinctrl
driver.
By having the gpio-ranges property, we can map every pin between
gpio node and pinctrl node and we can stop using the deprecated
pinctrl_add_gpio_range() function.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20201206105333.18428-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-pinctrl')
-rw-r--r-- | drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index caaf9e34f1ee..e61dbe186bc9 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -318,7 +318,6 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) { struct rt2880_priv *p; struct pinctrl_dev *dev; - struct device_node *np; if (!rt2880_pinmux_data) return -ENOTSUPP; @@ -346,34 +345,6 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) if (IS_ERR(dev)) return PTR_ERR(dev); - /* finalize by adding gpio ranges for enables gpio controllers */ - for_each_compatible_node(np, NULL, "ralink,rt2880-gpio") { - const __be32 *ngpio, *gpiobase; - struct pinctrl_gpio_range *range; - - if (!of_device_is_available(np)) - continue; - - ngpio = of_get_property(np, "ralink,num-gpios", NULL); - gpiobase = of_get_property(np, "ralink,gpio-base", NULL); - if (!ngpio || !gpiobase) { - dev_err(&pdev->dev, "failed to load chip info\n"); - of_node_put(np); - return -EINVAL; - } - - range = devm_kzalloc(p->dev, sizeof(*range), GFP_KERNEL); - if (!range) { - of_node_put(np); - return -ENOMEM; - } - range->name = "pio"; - range->npins = __be32_to_cpu(*ngpio); - range->base = __be32_to_cpu(*gpiobase); - range->pin_base = range->base; - pinctrl_add_gpio_range(dev, range); - } - return 0; } |