power: supply: max8998-charger: Fix platform data retrieval
authorTomasz Figa <tomasz.figa@gmail.com>
Tue, 17 Jul 2018 16:05:07 +0000 (18:05 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sun, 16 Sep 2018 11:46:39 +0000 (13:46 +0200)
Since the max8998 MFD driver supports instantiation by DT, platform data
retrieval is handled in MFD probe and cell drivers should get use
the pdata field of max8998_dev struct to obtain them.

Fixes: ee999fb3f17f ("mfd: max8998: Add support for Device Tree")
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/max8998_charger.c

index 9529238..9a926c7 100644 (file)
@@ -72,7 +72,7 @@ static const struct power_supply_desc max8998_battery_desc = {
 static int max8998_battery_probe(struct platform_device *pdev)
 {
        struct max8998_dev *iodev = dev_get_drvdata(pdev->dev.parent);
-       struct max8998_platform_data *pdata = dev_get_platdata(iodev->dev);
+       struct max8998_platform_data *pdata = iodev->pdata;
        struct power_supply_config psy_cfg = {};
        struct max8998_battery_data *max8998;
        struct i2c_client *i2c;