mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
watchdog: sprd: Fix the incorrect pointer getting from driver data
commit 39e68d9e7ab276880980ee5386301fb218202192 upstream.
The device driver data saved the 'struct sprd_wdt' object, it is
incorrect to get 'struct watchdog_device' object from the driver
data, thus fix it.
Fixes: 4776034670 ("watchdog: Add Spreadtrum watchdog driver")
Reported-by: Dongwei Wang <[email protected]>
Signed-off-by: Shuiqing Li <[email protected]>
Signed-off-by: Baolin Wang <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/76d4687189ec940baa90cb8d679a8d4c8f02ee80.1573210405.git.baolin.wang@linaro.org
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
8a43239f46
commit
2b35a57604
1 changed files with 2 additions and 4 deletions
|
|
@ -327,10 +327,9 @@ static int sprd_wdt_probe(struct platform_device *pdev)
|
|||
|
||||
static int __maybe_unused sprd_wdt_pm_suspend(struct device *dev)
|
||||
{
|
||||
struct watchdog_device *wdd = dev_get_drvdata(dev);
|
||||
struct sprd_wdt *wdt = dev_get_drvdata(dev);
|
||||
|
||||
if (watchdog_active(wdd))
|
||||
if (watchdog_active(&wdt->wdd))
|
||||
sprd_wdt_stop(&wdt->wdd);
|
||||
sprd_wdt_disable(wdt);
|
||||
|
||||
|
|
@ -339,7 +338,6 @@ static int __maybe_unused sprd_wdt_pm_suspend(struct device *dev)
|
|||
|
||||
static int __maybe_unused sprd_wdt_pm_resume(struct device *dev)
|
||||
{
|
||||
struct watchdog_device *wdd = dev_get_drvdata(dev);
|
||||
struct sprd_wdt *wdt = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
|
|
@ -347,7 +345,7 @@ static int __maybe_unused sprd_wdt_pm_resume(struct device *dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (watchdog_active(wdd)) {
|
||||
if (watchdog_active(&wdt->wdd)) {
|
||||
ret = sprd_wdt_start(&wdt->wdd);
|
||||
if (ret) {
|
||||
sprd_wdt_disable(wdt);
|
||||
|
|
|
|||
Loading…
Reference in a new issue