Skip to content

Commit

Permalink
watchdog: da9052: use platform_{get,set}_drvdata()
Browse files Browse the repository at this point in the history
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]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
  • Loading branch information
Jingoo Han authored and Wim Van Sebroeck committed Jul 11, 2013
1 parent 26556b6 commit 552a964
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/watchdog/da9052_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 552a964

Please sign in to comment.