linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] mfd: max77843: fix an error code in max77843_chg_init()
@ 2015-03-15 10:48 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-03-15 10:48 UTC (permalink / raw)
  To: Samuel Ortiz, Jaewon Kim; +Cc: Lee Jones, linux-kernel, kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/mfd/max77843.c b/drivers/mfd/max77843.c
index a354ac6..1074a0d 100644
--- a/drivers/mfd/max77843.c
+++ b/drivers/mfd/max77843.c
@@ -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);
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-15 10:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-15 10:48 [patch] mfd: max77843: fix an error code in max77843_chg_init() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).