Commit 2402ca5e300db0d88fce9e0b3a5218863c71b694
Committed by
Samuel Ortiz
1 parent
e6f1945b9e
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 2 additions and 8 deletions Side-by-side Diff
drivers/power/max8925_power.c
... | ... | @@ -425,16 +425,11 @@ |
425 | 425 | static __devinit int max8925_power_probe(struct platform_device *pdev) |
426 | 426 | { |
427 | 427 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); |
428 | - struct max8925_platform_data *max8925_pdata; | |
429 | 428 | struct max8925_power_pdata *pdata = NULL; |
430 | 429 | struct max8925_power_info *info; |
431 | 430 | int ret; |
432 | 431 | |
433 | - if (pdev->dev.parent->platform_data) { | |
434 | - max8925_pdata = pdev->dev.parent->platform_data; | |
435 | - pdata = max8925_pdata->power; | |
436 | - } | |
437 | - | |
432 | + pdata = pdev->dev.platform_data; | |
438 | 433 | if (!pdata) { |
439 | 434 | dev_err(&pdev->dev, "platform data isn't assigned to " |
440 | 435 | "power supply\n"); |
... | ... | @@ -447,6 +442,7 @@ |
447 | 442 | info->chip = chip; |
448 | 443 | info->gpm = chip->i2c; |
449 | 444 | info->adc = chip->adc; |
445 | + platform_set_drvdata(pdev, info); | |
450 | 446 | |
451 | 447 | info->ac.name = "max8925-ac"; |
452 | 448 | info->ac.type = POWER_SUPPLY_TYPE_MAINS; |
... | ... | @@ -482,8 +478,6 @@ |
482 | 478 | info->topoff_threshold = pdata->topoff_threshold; |
483 | 479 | info->fast_charge = pdata->fast_charge; |
484 | 480 | info->set_charger = pdata->set_charger; |
485 | - dev_set_drvdata(&pdev->dev, info); | |
486 | - platform_set_drvdata(pdev, info); | |
487 | 481 | |
488 | 482 | max8925_init_charger(chip, info); |
489 | 483 | return 0; |