[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150315104819.GB20691@mwanda>
Date: Sun, 15 Mar 2015 13:48:19 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Samuel Ortiz <sameo@...ux.intel.com>,
Jaewon Kim <jaewon02.kim@...sung.com>
Cc: Lee Jones <lee.jones@...aro.org>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] mfd: max77843: fix an error code in max77843_chg_init()
"max77843->i2c_chg" is NULL, not an error pointer. Let's return -ENODEV
instead.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists