Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: Use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>

authored by

Jingoo Han and committed by
Anton Vorontsov
e0835879 c509a62c

+3 -3
+1 -1
drivers/power/intel_mid_battery.c
··· 756 756 757 757 static int platform_pmic_battery_remove(struct platform_device *pdev) 758 758 { 759 - struct pmic_power_module_info *pbi = dev_get_drvdata(&pdev->dev); 759 + struct pmic_power_module_info *pbi = platform_get_drvdata(pdev); 760 760 761 761 free_irq(pbi->irq, pbi); 762 762 cancel_delayed_work_sync(&pbi->monitor_battery);
+2 -2
drivers/power/tps65090-charger.c
··· 218 218 return -ENOMEM; 219 219 } 220 220 221 - dev_set_drvdata(&pdev->dev, cdata); 221 + platform_set_drvdata(pdev, cdata); 222 222 223 223 cdata->dev = &pdev->dev; 224 224 cdata->pdata = pdata; ··· 291 291 292 292 static int tps65090_charger_remove(struct platform_device *pdev) 293 293 { 294 - struct tps65090_charger *cdata = dev_get_drvdata(&pdev->dev); 294 + struct tps65090_charger *cdata = platform_get_drvdata(pdev); 295 295 296 296 devm_free_irq(cdata->dev, cdata->irq, cdata); 297 297 power_supply_unregister(&cdata->ac);