watchdog: da9052: use platform_{get,set}_drvdata()
Subsystems (2)
PATCH 2/5 watchdog: da9052: 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 <[email protected]>
--- drivers/watchdog/da9052_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/da9052_wdt.c +2 -2
@@ -215,14 +215,14 @@ static int da9052_wdt_probe(struct platform_device *pdev) goto err; } -dev_set_drvdata (&pdev->dev, driver_data); +platform_set_drvdata (pdev, driver_data); err:return ret; }static int da9052_wdt_remove (struct platform_device *pdev) { -struct da9052_wdt_data *driver_data =dev_get_drvdata (&pdev->dev); +struct da9052_wdt_data *driver_data =platform_get_drvdata (pdev);watchdog_unregister_device (&driver_data->wdt);kref_put (&driver_data->kref, da9052_wdt_release_resources);
Signature · 1 line
1.7.10.4
Quoted 5 lines · Jingoo Han
Use the wrapper functions for getting and setting the driver data using
platform_deviceinstead of using dev_{get,set}_drvdata() with&pdev->dev, so we can directly pass a structplatform_device.Signed-off-by Jingoo Han <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Quoted 30 lines
--- drivers/watchdog/da9052_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/watchdog/da9052_wdt.c +2
-2@@ -215,14 +215,14 @@ static int da9052_wdt_probe(struct platform_device *pdev) goto err; } -dev_set_drvdata (&pdev->dev, driver_data); +platform_set_drvdata (pdev, driver_data); err:return ret; }static int da9052_wdt_remove (struct platform_device *pdev) { -struct da9052_wdt_data *driver_data =dev_get_drvdata (&pdev->dev); +struct da9052_wdt_data *driver_data =platform_get_drvdata (pdev);watchdog_unregister_device (&driver_data->wdt);kref_put (&driver_data->kref, da9052_wdt_release_resources);Signature · 1 line
1.7.10.4
Hi Jingoo,
Quoted 9 lines
Use the wrapper functions for getting and setting the driver data using
platform_deviceinstead of using dev_{get,set}_drvdata() with&pdev->dev, so we can directly pass a structplatform_device.Signed-off-by Jingoo Han <[email protected]>--- drivers/watchdog/da9052_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Patch added to linux-watchdog-next.
Kind regards,
Wim.