Skip to contentSkip to conversation

mfd: max77843: fix an error code in max77843_chg_init()

PATCH New Dan Carpenter 1 participant 1 message Mar 15, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: max77843: fix an error code in max77843_chg_init()

"max77843->i2c_chg" is NULL, not an error pointer. Let's return -ENODEV instead.

drivers/mfd/max77843.c +1 -1
index a354ac6..1074a0d 100644
@@ -79,7 +79,7 @@ static int max77843_chg_init(struct max77843 *max77843)
 	if (!max77843->i2c_chg) {
 		dev_err(&max77843->i2c->dev,
 				"Cannot allocate I2C device for Charger\n");
-		return PTR_ERR(max77843->i2c_chg);
+		return -ENODEV;
 	}
 	i2c_set_clientdata(max77843->i2c_chg, max77843);