From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1izfGW-0005pK-1i for barebox@lists.infradead.org; Thu, 06 Feb 2020 11:24:14 +0000 From: Ahmad Fatoum Date: Thu, 6 Feb 2020 12:23:31 +0100 Message-Id: <20200206112334.14314-6-a.fatoum@pengutronix.de> In-Reply-To: <20200206112334.14314-1-a.fatoum@pengutronix.de> References: <20200206112334.14314-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 5/8] led: pwm: don't test if pointer is smaller than zero To: barebox@lists.infradead.org Cc: Ahmad Fatoum of_pwm_request returns either the valid or an error pointer. Revise the error check to reflect this. Signed-off-by: Ahmad Fatoum --- 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@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox