Commit 528c9515 authored by Marek Behún's avatar Marek Behún Committed by Pavel Machek

leds: ns2: use devres API for getting GPIO descriptors

This drivers leaks GPIO descriptors on driver removal. Use devres API
function devm_gpiod_get_from_of_node instead of gpiod_get_from_of_node
to avoid this.
Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
Cc: Simon Guinot <simon.guinot@sequanux.org>
Cc: Simon Guinot <sguinot@lacie.com>
Cc: Vincent Donnefort <vdonnefort@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Not-for-stable
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent f72deb71
......@@ -240,13 +240,13 @@ static int ns2_leds_parse_one(struct device *dev, struct device_node *np,
if (ret)
led->name = np->name;
led->cmd = gpiod_get_from_of_node(np, "cmd-gpio", 0, GPIOD_ASIS,
led->name);
led->cmd = devm_gpiod_get_from_of_node(dev, np, "cmd-gpio", 0,
GPIOD_ASIS, led->name);
if (IS_ERR(led->cmd))
return PTR_ERR(led->cmd);
led->slow = gpiod_get_from_of_node(np, "slow-gpio", 0, GPIOD_ASIS,
led->name);
led->slow = devm_gpiod_get_from_of_node(dev, np, "slow-gpio", 0,
GPIOD_ASIS, led->name);
if (IS_ERR(led->slow))
return PTR_ERR(led->slow);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment