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>
This commit is contained in:

committed by
Linus Walleij

parent
33dd888263
commit
f0254b51cb
@@ -259,11 +259,8 @@ static int davinci_gpio_probe(struct platform_device *pdev)
|
||||
chips->chip.of_gpio_n_cells = 2;
|
||||
chips->chip.parent = dev;
|
||||
chips->chip.of_node = dev->of_node;
|
||||
|
||||
if (of_property_read_bool(dev->of_node, "gpio-ranges")) {
|
||||
chips->chip.request = gpiochip_generic_request;
|
||||
chips->chip.free = gpiochip_generic_free;
|
||||
}
|
||||
chips->chip.request = gpiochip_generic_request;
|
||||
chips->chip.free = gpiochip_generic_free;
|
||||
#endif
|
||||
spin_lock_init(&chips->lock);
|
||||
|
||||
|
Reference in New Issue
Block a user