Skip to contentSkip to conversation

regulator: tps80031: Use IS_ERR to check return value of regulator_register()

PATCH Applied Axel Lin 2 participants 2 messages Jan 25, 2013 – Jan 26, 2013 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: tps80031: Use IS_ERR to check return value of regulator_register()

regulator_register() does not return NULL, it returns ERR_PTR on error.

---
 drivers/regulator/tps80031-regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/tps80031-regulator.c +1 -1
index b15d711..9019d0e 100644
@@ -728,7 +728,7 @@ static int tps80031_regulator_probe(struct platform_device *pdev)
 			}
 		}
 		rdev = regulator_register(&ri->rinfo->desc, &config);
-		if (IS_ERR_OR_NULL(rdev)) {
+		if (IS_ERR(rdev)) {
 			dev_err(&pdev->dev,
 				"register regulator failed %s\n",
 					ri->rinfo->desc.name);
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 1 line · Axel Lin

regulator_register() does not return NULL, it returns ERR_PTR on error.

Applied, thanks.