[PATCH 4/5] net: macb: fix wrong return values on some errors

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Oct 1 03:43:36 EDT 2020


Coccinelle detected that the IS_ERR and ERR_PTR are mismatched.
Fix it.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/net/macb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 4850e60c49ab..e3e039f67988 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -731,7 +731,7 @@ static int macb_probe(struct device_d *dev)
 
 	if (hclk_name) {
 		macb->hclk = clk_get(dev, pclk_name);
-		if (IS_ERR(macb->pclk)) {
+		if (IS_ERR(macb->hclk)) {
 			dev_err(dev, "no hclk\n");
 			return PTR_ERR(macb->hclk);
 		}
-- 
2.28.0




More information about the barebox mailing list