mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Myungjoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Reported-by: Sylwester Nawrocki <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
d51f42d2c5
commit
b186b12487
2 changed files with 26 additions and 7 deletions
|
|
@ -669,13 +669,18 @@ static int __devinit max77693_muic_probe(struct platform_device *pdev)
|
|||
}
|
||||
info->dev = &pdev->dev;
|
||||
info->max77693 = max77693;
|
||||
info->max77693->regmap_muic = regmap_init_i2c(info->max77693->muic,
|
||||
&max77693_muic_regmap_config);
|
||||
if (IS_ERR(info->max77693->regmap_muic)) {
|
||||
ret = PTR_ERR(info->max77693->regmap_muic);
|
||||
dev_err(max77693->dev,
|
||||
"failed to allocate register map: %d\n", ret);
|
||||
goto err_regmap;
|
||||
if (info->max77693->regmap_muic)
|
||||
dev_dbg(&pdev->dev, "allocate register map\n");
|
||||
else {
|
||||
info->max77693->regmap_muic = devm_regmap_init_i2c(
|
||||
info->max77693->muic,
|
||||
&max77693_muic_regmap_config);
|
||||
if (IS_ERR(info->max77693->regmap_muic)) {
|
||||
ret = PTR_ERR(info->max77693->regmap_muic);
|
||||
dev_err(max77693->dev,
|
||||
"failed to allocate register map: %d\n", ret);
|
||||
goto err_regmap;
|
||||
}
|
||||
}
|
||||
platform_set_drvdata(pdev, info);
|
||||
mutex_init(&info->mutex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue