Thread (1 message) 1 message, 1 author, 2015-09-28
DORMANTno replies REVIEWED: 1 (0M)

[PATCH v8 04/14] power: bq24257: Simplify bq24257_power_supply_init()

From: Andreas Dannenberg <hidden>
Date: 2015-09-28 22:33:52
Also in: linux-devicetree, linux-pm
Subsystem: the rest · Maintainer: Linus Torvalds

Eliminate a few lines of code by using the PTR_ERR_OR_ZERO() macro.

Signed-off-by: Andreas Dannenberg <redacted>
Reviewed-by: Krzysztof Kozlowski <redacted>
---
 drivers/power/bq24257_charger.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/power/bq24257_charger.c b/drivers/power/bq24257_charger.c
index 6757b41..060f754 100644
--- a/drivers/power/bq24257_charger.c
+++ b/drivers/power/bq24257_charger.c
@@ -594,10 +594,7 @@ static int bq24257_power_supply_init(struct bq24257_device *bq)
 						 &bq24257_power_supply_desc,
 						 &psy_cfg);
 
-	if (IS_ERR(bq->charger))
-		return PTR_ERR(bq->charger);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(bq->charger);
 }
 
 static int bq24257_pg_gpio_probe(struct bq24257_device *bq)
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help