mfd: max77686: Fix NULL pointer error of max77686 platform data.
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Fri, 5 Apr 2013 06:55:47 +0000 (15:55 +0900)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:42:58 +0000 (11:42 +0900)
If max77686 mfd driver gets the initial data from device tree,
dev->plat_data might be NULL. So, when sub devices want to get
parent platform data, it can get only NULL pointer even parent
mfd driver probed completely. So we need to re-initialize
dev->plat_data at end of parsing device tree.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
drivers/mfd/max77686.c

index 1b6f45a..7c9757e 100644 (file)
@@ -81,7 +81,8 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
        int ret = 0;
 
        if (i2c->dev.of_node)
-               pdata = max77686_i2c_parse_dt_pdata(&i2c->dev);
+               pdata = i2c->dev.platform_data =
+                       max77686_i2c_parse_dt_pdata(&i2c->dev);
 
        if (!pdata) {
                ret = -EIO;