mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
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>
This commit is contained in:
parent
e6f1945b9e
commit
2402ca5e30
1 changed files with 2 additions and 8 deletions
|
@ -425,16 +425,11 @@ static __devexit int max8925_deinit_charger(struct max8925_power_info *info)
|
||||||
static __devinit int max8925_power_probe(struct platform_device *pdev)
|
static __devinit int max8925_power_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
|
struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
|
||||||
struct max8925_platform_data *max8925_pdata;
|
|
||||||
struct max8925_power_pdata *pdata = NULL;
|
struct max8925_power_pdata *pdata = NULL;
|
||||||
struct max8925_power_info *info;
|
struct max8925_power_info *info;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (pdev->dev.parent->platform_data) {
|
pdata = pdev->dev.platform_data;
|
||||||
max8925_pdata = pdev->dev.parent->platform_data;
|
|
||||||
pdata = max8925_pdata->power;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pdata) {
|
if (!pdata) {
|
||||||
dev_err(&pdev->dev, "platform data isn't assigned to "
|
dev_err(&pdev->dev, "platform data isn't assigned to "
|
||||||
"power supply\n");
|
"power supply\n");
|
||||||
|
@ -447,6 +442,7 @@ static __devinit int max8925_power_probe(struct platform_device *pdev)
|
||||||
info->chip = chip;
|
info->chip = chip;
|
||||||
info->gpm = chip->i2c;
|
info->gpm = chip->i2c;
|
||||||
info->adc = chip->adc;
|
info->adc = chip->adc;
|
||||||
|
platform_set_drvdata(pdev, info);
|
||||||
|
|
||||||
info->ac.name = "max8925-ac";
|
info->ac.name = "max8925-ac";
|
||||||
info->ac.type = POWER_SUPPLY_TYPE_MAINS;
|
info->ac.type = POWER_SUPPLY_TYPE_MAINS;
|
||||||
|
@ -482,8 +478,6 @@ static __devinit int max8925_power_probe(struct platform_device *pdev)
|
||||||
info->topoff_threshold = pdata->topoff_threshold;
|
info->topoff_threshold = pdata->topoff_threshold;
|
||||||
info->fast_charge = pdata->fast_charge;
|
info->fast_charge = pdata->fast_charge;
|
||||||
info->set_charger = pdata->set_charger;
|
info->set_charger = pdata->set_charger;
|
||||||
dev_set_drvdata(&pdev->dev, info);
|
|
||||||
platform_set_drvdata(pdev, info);
|
|
||||||
|
|
||||||
max8925_init_charger(chip, info);
|
max8925_init_charger(chip, info);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue