diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2020-09-18 01:33:28 +0300 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2020-09-26 22:56:41 +0300 |
commit | 528c9515b28d48691f8ef545595be77857e211dc (patch) | |
tree | 6ae8cbc75a418aacb2165b45dd331220ecec6169 /drivers/leds/leds-ns2.c | |
parent | f72deb717d5b80b3b90ebcb4e4b73b041e2eb465 (diff) | |
download | linux-528c9515b28d48691f8ef545595be77857e211dc.tar.xz |
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: Marek 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: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-ns2.c')
-rw-r--r-- | drivers/leds/leds-ns2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 46d4f7e963c0..fa06ab40ee14 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c @@ -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); |