diff options
| author | Jingoo Han <jg1.han@samsung.com> | 2013-07-30 06:58:51 -0400 |
|---|---|---|
| committer | Wim Van Sebroeck <wim@iguana.be> | 2013-11-17 13:34:20 -0500 |
| commit | bc8fdfbe75058c6569dd6a08bdc2a411db533c47 (patch) | |
| tree | 0d6bc33b1f36fac7b744b49971ea8013f5b88cbc | |
| parent | 813296a1a209baaf1471c360591946edd795bcbe (diff) | |
watchdog: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| -rw-r--r-- | drivers/watchdog/iTCO_wdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/mv64x60_wdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/omap_wdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/rdc321x_wdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/stmp3xxx_rtc_wdt.c | 4 | ||||
| -rw-r--r-- | drivers/watchdog/ux500_wdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/wm831x_wdt.c | 8 |
7 files changed, 10 insertions, 12 deletions
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index 6130321da387..439b160b3e0f 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
| @@ -394,7 +394,7 @@ static int iTCO_wdt_probe(struct platform_device *dev) | |||
| 394 | { | 394 | { |
| 395 | int ret = -ENODEV; | 395 | int ret = -ENODEV; |
| 396 | unsigned long val32; | 396 | unsigned long val32; |
| 397 | struct lpc_ich_info *ich_info = dev->dev.platform_data; | 397 | struct lpc_ich_info *ich_info = dev_get_platdata(&dev->dev); |
| 398 | 398 | ||
| 399 | if (!ich_info) | 399 | if (!ich_info) |
| 400 | goto out; | 400 | goto out; |
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c index e4cf98019265..2f2ff19da6e2 100644 --- a/drivers/watchdog/mv64x60_wdt.c +++ b/drivers/watchdog/mv64x60_wdt.c | |||
| @@ -255,7 +255,7 @@ static struct miscdevice mv64x60_wdt_miscdev = { | |||
| 255 | 255 | ||
| 256 | static int mv64x60_wdt_probe(struct platform_device *dev) | 256 | static int mv64x60_wdt_probe(struct platform_device *dev) |
| 257 | { | 257 | { |
| 258 | struct mv64x60_wdt_pdata *pdata = dev->dev.platform_data; | 258 | struct mv64x60_wdt_pdata *pdata = dev_get_platdata(&dev->dev); |
| 259 | struct resource *r; | 259 | struct resource *r; |
| 260 | int timeout = 10; | 260 | int timeout = 10; |
| 261 | 261 | ||
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index af88ffd1068f..7b79ca093e89 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
| @@ -205,7 +205,7 @@ static const struct watchdog_ops omap_wdt_ops = { | |||
| 205 | 205 | ||
| 206 | static int omap_wdt_probe(struct platform_device *pdev) | 206 | static int omap_wdt_probe(struct platform_device *pdev) |
| 207 | { | 207 | { |
| 208 | struct omap_wd_timer_platform_data *pdata = pdev->dev.platform_data; | 208 | struct omap_wd_timer_platform_data *pdata = dev_get_platdata(&pdev->dev); |
| 209 | struct watchdog_device *omap_wdt; | 209 | struct watchdog_device *omap_wdt; |
| 210 | struct resource *res, *mem; | 210 | struct resource *res, *mem; |
| 211 | struct omap_wdt_dev *wdev; | 211 | struct omap_wdt_dev *wdev; |
diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c index b0f116c2fd53..8d5facd680b1 100644 --- a/drivers/watchdog/rdc321x_wdt.c +++ b/drivers/watchdog/rdc321x_wdt.c | |||
| @@ -231,7 +231,7 @@ static int rdc321x_wdt_probe(struct platform_device *pdev) | |||
| 231 | struct resource *r; | 231 | struct resource *r; |
| 232 | struct rdc321x_wdt_pdata *pdata; | 232 | struct rdc321x_wdt_pdata *pdata; |
| 233 | 233 | ||
| 234 | pdata = pdev->dev.platform_data; | 234 | pdata = dev_get_platdata(&pdev->dev); |
| 235 | if (!pdata) { | 235 | if (!pdata) { |
| 236 | dev_err(&pdev->dev, "no platform data supplied\n"); | 236 | dev_err(&pdev->dev, "no platform data supplied\n"); |
| 237 | return -ENODEV; | 237 | return -ENODEV; |
diff --git a/drivers/watchdog/stmp3xxx_rtc_wdt.c b/drivers/watchdog/stmp3xxx_rtc_wdt.c index c97e98dcde62..7bf8c508862b 100644 --- a/drivers/watchdog/stmp3xxx_rtc_wdt.c +++ b/drivers/watchdog/stmp3xxx_rtc_wdt.c | |||
| @@ -30,7 +30,7 @@ MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat period in seconds from 1 to " | |||
| 30 | static int wdt_start(struct watchdog_device *wdd) | 30 | static int wdt_start(struct watchdog_device *wdd) |
| 31 | { | 31 | { |
| 32 | struct device *dev = watchdog_get_drvdata(wdd); | 32 | struct device *dev = watchdog_get_drvdata(wdd); |
| 33 | struct stmp3xxx_wdt_pdata *pdata = dev->platform_data; | 33 | struct stmp3xxx_wdt_pdata *pdata = dev_get_platdata(dev); |
| 34 | 34 | ||
| 35 | pdata->wdt_set_timeout(dev->parent, wdd->timeout * WDOG_TICK_RATE); | 35 | pdata->wdt_set_timeout(dev->parent, wdd->timeout * WDOG_TICK_RATE); |
| 36 | return 0; | 36 | return 0; |
| @@ -39,7 +39,7 @@ static int wdt_start(struct watchdog_device *wdd) | |||
| 39 | static int wdt_stop(struct watchdog_device *wdd) | 39 | static int wdt_stop(struct watchdog_device *wdd) |
| 40 | { | 40 | { |
| 41 | struct device *dev = watchdog_get_drvdata(wdd); | 41 | struct device *dev = watchdog_get_drvdata(wdd); |
| 42 | struct stmp3xxx_wdt_pdata *pdata = dev->platform_data; | 42 | struct stmp3xxx_wdt_pdata *pdata = dev_get_platdata(dev); |
| 43 | 43 | ||
| 44 | pdata->wdt_set_timeout(dev->parent, 0); | 44 | pdata->wdt_set_timeout(dev->parent, 0); |
| 45 | return 0; | 45 | return 0; |
diff --git a/drivers/watchdog/ux500_wdt.c b/drivers/watchdog/ux500_wdt.c index a614d84121c3..d9af93458df3 100644 --- a/drivers/watchdog/ux500_wdt.c +++ b/drivers/watchdog/ux500_wdt.c | |||
| @@ -88,7 +88,7 @@ static struct watchdog_device ux500_wdt = { | |||
| 88 | static int ux500_wdt_probe(struct platform_device *pdev) | 88 | static int ux500_wdt_probe(struct platform_device *pdev) |
| 89 | { | 89 | { |
| 90 | int ret; | 90 | int ret; |
| 91 | struct ux500_wdt_data *pdata = pdev->dev.platform_data; | 91 | struct ux500_wdt_data *pdata = dev_get_platdata(&pdev->dev); |
| 92 | 92 | ||
| 93 | if (pdata) { | 93 | if (pdata) { |
| 94 | if (pdata->timeout > 0) | 94 | if (pdata->timeout > 0) |
diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c index d4e47eda4182..e243bd01c774 100644 --- a/drivers/watchdog/wm831x_wdt.c +++ b/drivers/watchdog/wm831x_wdt.c | |||
| @@ -184,7 +184,7 @@ static const struct watchdog_ops wm831x_wdt_ops = { | |||
| 184 | static int wm831x_wdt_probe(struct platform_device *pdev) | 184 | static int wm831x_wdt_probe(struct platform_device *pdev) |
| 185 | { | 185 | { |
| 186 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 186 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
| 187 | struct wm831x_pdata *chip_pdata; | 187 | struct wm831x_pdata *chip_pdata = dev_get_platdata(pdev->dev.parent); |
| 188 | struct wm831x_watchdog_pdata *pdata; | 188 | struct wm831x_watchdog_pdata *pdata; |
| 189 | struct wm831x_wdt_drvdata *driver_data; | 189 | struct wm831x_wdt_drvdata *driver_data; |
| 190 | struct watchdog_device *wm831x_wdt; | 190 | struct watchdog_device *wm831x_wdt; |
| @@ -231,12 +231,10 @@ static int wm831x_wdt_probe(struct platform_device *pdev) | |||
| 231 | wm831x_wdt->timeout = wm831x_wdt_cfgs[i].time; | 231 | wm831x_wdt->timeout = wm831x_wdt_cfgs[i].time; |
| 232 | 232 | ||
| 233 | /* Apply any configuration */ | 233 | /* Apply any configuration */ |
| 234 | if (pdev->dev.parent->platform_data) { | 234 | if (chip_pdata) |
| 235 | chip_pdata = pdev->dev.parent->platform_data; | ||
| 236 | pdata = chip_pdata->watchdog; | 235 | pdata = chip_pdata->watchdog; |
| 237 | } else { | 236 | else |
| 238 | pdata = NULL; | 237 | pdata = NULL; |
| 239 | } | ||
| 240 | 238 | ||
| 241 | if (pdata) { | 239 | if (pdata) { |
| 242 | reg &= ~(WM831X_WDOG_SECACT_MASK | WM831X_WDOG_PRIMACT_MASK | | 240 | reg &= ~(WM831X_WDOG_SECACT_MASK | WM831X_WDOG_PRIMACT_MASK | |
