diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2011-04-18 10:04:08 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-26 13:45:32 -0400 |
commit | 2402ca5e300db0d88fce9e0b3a5218863c71b694 (patch) | |
tree | 9d8ef1d793b4409d43d5da699a016466514a3574 /drivers/power | |
parent | e6f1945b9e71cbc8498e5fbf8d5352331ac5da14 (diff) |
power_supply: Use max8925 platform_data from cell
Avoid to get platform_data from parent device. Get it from mfd cell
device instead.
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/max8925_power.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/power/max8925_power.c b/drivers/power/max8925_power.c index 8e5aec260866..a70e16d3a3dc 100644 --- a/drivers/power/max8925_power.c +++ b/drivers/power/max8925_power.c | |||
@@ -425,16 +425,11 @@ static __devexit int max8925_deinit_charger(struct max8925_power_info *info) | |||
425 | static __devinit int max8925_power_probe(struct platform_device *pdev) | 425 | static __devinit int max8925_power_probe(struct platform_device *pdev) |
426 | { | 426 | { |
427 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | 427 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); |
428 | struct max8925_platform_data *max8925_pdata; | ||
429 | struct max8925_power_pdata *pdata = NULL; | 428 | struct max8925_power_pdata *pdata = NULL; |
430 | struct max8925_power_info *info; | 429 | struct max8925_power_info *info; |
431 | int ret; | 430 | int ret; |
432 | 431 | ||
433 | if (pdev->dev.parent->platform_data) { | 432 | pdata = pdev->dev.platform_data; |
434 | max8925_pdata = pdev->dev.parent->platform_data; | ||
435 | pdata = max8925_pdata->power; | ||
436 | } | ||
437 | |||
438 | if (!pdata) { | 433 | if (!pdata) { |
439 | dev_err(&pdev->dev, "platform data isn't assigned to " | 434 | dev_err(&pdev->dev, "platform data isn't assigned to " |
440 | "power supply\n"); | 435 | "power supply\n"); |
@@ -447,6 +442,7 @@ static __devinit int max8925_power_probe(struct platform_device *pdev) | |||
447 | info->chip = chip; | 442 | info->chip = chip; |
448 | info->gpm = chip->i2c; | 443 | info->gpm = chip->i2c; |
449 | info->adc = chip->adc; | 444 | info->adc = chip->adc; |
445 | platform_set_drvdata(pdev, info); | ||
450 | 446 | ||
451 | info->ac.name = "max8925-ac"; | 447 | info->ac.name = "max8925-ac"; |
452 | info->ac.type = POWER_SUPPLY_TYPE_MAINS; | 448 | info->ac.type = POWER_SUPPLY_TYPE_MAINS; |
@@ -482,8 +478,6 @@ static __devinit int max8925_power_probe(struct platform_device *pdev) | |||
482 | info->topoff_threshold = pdata->topoff_threshold; | 478 | info->topoff_threshold = pdata->topoff_threshold; |
483 | info->fast_charge = pdata->fast_charge; | 479 | info->fast_charge = pdata->fast_charge; |
484 | info->set_charger = pdata->set_charger; | 480 | info->set_charger = pdata->set_charger; |
485 | dev_set_drvdata(&pdev->dev, info); | ||
486 | platform_set_drvdata(pdev, info); | ||
487 | 481 | ||
488 | max8925_init_charger(chip, info); | 482 | max8925_init_charger(chip, info); |
489 | return 0; | 483 | return 0; |