[PATCH 5/8] led: pwm: don't test if pointer is smaller than zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/led/led-pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/led/led-pwm.c b/drivers/led/led-pwm.c
index 16d22b55695e..2b53614ed388 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));
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux