summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-zx.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2020-04-01 22:05:26 +0200
committerLinus Walleij <linus.walleij@linaro.org>2020-04-02 09:16:06 +0200
commitf0254b51cbbfe040142cb824a1ff623de698ae8a (patch)
treecad69cf2e336acfab7749862e34383431084ae8a /drivers/gpio/gpio-zx.c
parent33dd888263199676946f1c789e821d39a9a79d98 (diff)
downloadlinux-f0254b51cbbfe040142cb824a1ff623de698ae8a.tar.gz
linux-f0254b51cbbfe040142cb824a1ff623de698ae8a.tar.bz2
linux-f0254b51cbbfe040142cb824a1ff623de698ae8a.zip
gpio: Unconditionally assign .request()/.free()
The gpiochip_generic_request() and gpiochip_generic_free() functions can now deal properly with chips that don't have any pin-ranges defined, so they can be assigned unconditionally. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20200401200527.2982450-1-thierry.reding@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-zx.c')
-rw-r--r--drivers/gpio/gpio-zx.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-zx.c b/drivers/gpio/gpio-zx.c
index 98cbaf0e415e..64bfb722756a 100644
--- a/drivers/gpio/gpio-zx.c
+++ b/drivers/gpio/gpio-zx.c
@@ -226,13 +226,11 @@ static int zx_gpio_probe(struct platform_device *pdev)
if (IS_ERR(chip->base))
return PTR_ERR(chip->base);
- raw_spin_lock_init(&chip->lock);
- if (of_property_read_bool(dev->of_node, "gpio-ranges")) {
- chip->gc.request = gpiochip_generic_request;
- chip->gc.free = gpiochip_generic_free;
- }
-
id = of_alias_get_id(dev->of_node, "gpio");
+
+ raw_spin_lock_init(&chip->lock);
+ chip->gc.request = gpiochip_generic_request;
+ chip->gc.free = gpiochip_generic_free;
chip->gc.direction_input = zx_direction_input;
chip->gc.direction_output = zx_direction_output;
chip->gc.get = zx_get_value;