[PATCH] watchdog: sp805: call watchdog_set_drvdata() early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



wdt_setload() uses watchdog_get_drvdata() and hence we must call
watchdog_set_drvdata() before actually calling wdt_setload(). This patch moves
watchdog_set_drvdata() up in code.

Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxx>
---
 drivers/watchdog/sp805_wdt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 40e628a..ef85676 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -250,6 +250,7 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
 	wdt->wdd.ops = &wdt_ops;
 
 	spin_lock_init(&wdt->lock);
+	watchdog_set_drvdata(&wdt->wdd, wdt);
 	watchdog_set_nowayout(&wdt->wdd, nowayout);
 	wdt_setload(&wdt->wdd, DEFAULT_TIMEOUT);
 
@@ -260,7 +261,6 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
 		goto err_register;
 	}
 	amba_set_drvdata(adev, wdt);
-	watchdog_set_drvdata(&wdt->wdd, wdt);
 
 	dev_info(&adev->dev, "registration successful\n");
 	return 0;
-- 
1.7.10.rc2.10.gb47606

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux