summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2012-08-21 15:16:23 +0900
committerSamuel Ortiz <sameo@linux.intel.com>2012-09-16 00:32:37 +0200
commit887780b85a8dde06224f33681ecc4fac73b92a36 (patch)
treeb70c571248670d1d3985e489b698f239dabde655 /drivers/mfd
parentf84e9954f7352293e223b0b5f3b13c09e7cba098 (diff)
downloadop-kernel-dev-887780b85a8dde06224f33681ecc4fac73b92a36.zip
op-kernel-dev-887780b85a8dde06224f33681ecc4fac73b92a36.tar.gz
mfd: MAX77693: Fix NULL pointer error when initializing irqs
This patch initialize register map of MUIC device because mfd driver of Maxim MAX77693 use regmap-muic instance of MUIC device when irqs of Maxim MAX77693 is initialized before call max77693-muic probe() function. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/max77693.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index 4fdd03d..cc5155e 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -152,6 +152,20 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
max77693->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC);
i2c_set_clientdata(max77693->haptic, max77693);
+ /*
+ * Initialize register map for MUIC device because use regmap-muic
+ * instance of MUIC device when irq of max77693 is initialized
+ * before call max77693-muic probe() function.
+ */
+ max77693->regmap_muic = devm_regmap_init_i2c(max77693->muic,
+ &max77693_regmap_config);
+ if (IS_ERR(max77693->regmap_muic)) {
+ ret = PTR_ERR(max77693->regmap_muic);
+ dev_err(max77693->dev,
+ "failed to allocate register map: %d\n", ret);
+ goto err_regmap;
+ }
+
ret = max77693_irq_init(max77693);
if (ret < 0)
goto err_irq;
OpenPOWER on IntegriCloud