[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1369716541-20034-2-git-send-email-yizhang.mrvl@gmail.com>
Date: Tue, 28 May 2013 12:48:58 +0800
From: <yizhang.mrvl@...il.com>
To: <sameo@...ux.intel.com>, <arnd@...db.de>
CC: <gregkh@...uxfoundation.org>, <cxie4@...vell.com>,
<jtzhou@...vell.com>, <yizhang@...vell.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH v2 1/4] mfd: 88pm800: fix NULL pointer error
From: Yi Zhang <yizhang@...vell.com>
move "device_800_init" to fix NULL pointer error when
calling "device_gpadc_init"
for "device_gpadc_init" needs "subchip->regmap_gpadc"
to set registers via regmap interface
Signed-off-by: Yi Zhang <yizhang@...vell.com>
---
drivers/mfd/88pm800.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c
index 582bda5..bbb6aa8 100644
--- a/drivers/mfd/88pm800.c
+++ b/drivers/mfd/88pm800.c
@@ -528,25 +528,25 @@ static int pm800_probe(struct i2c_client *client,
subchip->gpadc_page_addr = pdata->gpadc_page_addr;
chip->subchip = subchip;
- ret = device_800_init(chip, pdata);
- if (ret) {
- dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id);
- goto err_subchip_alloc;
- }
-
ret = pm800_pages_init(chip);
if (ret) {
dev_err(&client->dev, "pm800_pages_init failed!\n");
goto err_page_init;
}
+ ret = device_800_init(chip, pdata);
+ if (ret) {
+ dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id);
+ goto err_subchip_alloc;
+ }
+
if (pdata->plat_config)
pdata->plat_config(chip, pdata);
-err_page_init:
+err_subchip_alloc:
mfd_remove_devices(chip->dev);
device_irq_exit_800(chip);
-err_subchip_alloc:
+err_page_init:
pm80x_deinit();
out_init:
return ret;
--
1.7.4.1
--
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