* [PATCH] leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt
@ 2021-12-13 19:03 Lad Prabhakar
2021-12-15 20:29 ` Pavel Machek
0 siblings, 1 reply; 2+ messages in thread
From: Lad Prabhakar @ 2021-12-13 19:03 UTC (permalink / raw)
To: Pavel Machek, linux-leds; +Cc: linux-kernel, Prabhakar, Lad Prabhakar
output of dev_of_node() is already assigned to "np" variable in
ktd2692_parse_dt(). Use "np" variable to check if OF node is NULL
instead of calling dev_of_node() again.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
drivers/leds/flash/leds-ktd2692.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/flash/leds-ktd2692.c b/drivers/leds/flash/leds-ktd2692.c
index f341da1503a4..ed1f20a58bf6 100644
--- a/drivers/leds/flash/leds-ktd2692.c
+++ b/drivers/leds/flash/leds-ktd2692.c
@@ -274,7 +274,7 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
struct device_node *child_node;
int ret;
- if (!dev_of_node(dev))
+ if (!np)
return -ENXIO;
led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt
2021-12-13 19:03 [PATCH] leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt Lad Prabhakar
@ 2021-12-15 20:29 ` Pavel Machek
0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2021-12-15 20:29 UTC (permalink / raw)
To: Lad Prabhakar; +Cc: linux-leds, linux-kernel, Prabhakar
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]
On Mon 2021-12-13 19:03:31, Lad Prabhakar wrote:
> output of dev_of_node() is already assigned to "np" variable in
> ktd2692_parse_dt(). Use "np" variable to check if OF node is NULL
> instead of calling dev_of_node() again.
>
> Signed-off-by: Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com>
Thank you, applied.
Pavel
--
http://www.livejournal.com/~pavelmachek
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-15 20:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 19:03 [PATCH] leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt Lad Prabhakar
2021-12-15 20:29 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).