summaryrefslogtreecommitdiffstats
path: root/drivers/led/led-pwm.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-02-06 12:23:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-10 09:16:15 +0100
commit213192253a4d8599f1d8127a7bdf87b80c767650 (patch)
treea4b0971c627e25622967f145c347b82f6ba8594b /drivers/led/led-pwm.c
parent1572a1f1a65b1507c6ef4cef0c880b96df2ab77b (diff)
downloadbarebox-213192253a4d8599f1d8127a7bdf87b80c767650.tar.gz
barebox-213192253a4d8599f1d8127a7bdf87b80c767650.tar.xz
led: pwm: don't test if pointer is smaller than zero
of_pwm_request returns either the valid or an error pointer. Revise the error check to reflect this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/led/led-pwm.c')
-rw-r--r--drivers/led/led-pwm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/led/led-pwm.c b/drivers/led/led-pwm.c
index 16d22b5569..2b53614ed3 100644
--- a/drivers/led/led-pwm.c
+++ b/drivers/led/led-pwm.c
@@ -54,7 +54,7 @@ static int led_pwm_of_probe(struct device_d *dev)
struct pwm_device *pwm;
pwm = of_pwm_request(child, NULL);
- if (pwm < 0)
+ if (IS_ERR(pwm))
continue;
pwmled = xzalloc(sizeof(*pwmled));