diff options
author | Eric Anholt <eric@anholt.net> | 2017-04-27 18:02:32 -0700 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2017-05-19 10:42:25 +0200 |
commit | fedf266f9955d9a019643cde199a2fd9a0259f6f (patch) | |
tree | c3900d461bcceb71ba22ce130e31dbe7e4001c84 | |
parent | 07441a7dd11f6855bcf55fbbfc6abba42258b2c6 (diff) | |
download | linux-fedf266f9955d9a019643cde199a2fd9a0259f6f.tar.gz linux-fedf266f9955d9a019643cde199a2fd9a0259f6f.tar.bz2 linux-fedf266f9955d9a019643cde199a2fd9a0259f6f.zip |
watchdog: bcm281xx: Fix use of uninitialized spinlock.
The bcm_kona_wdt_set_resolution_reg() call takes the spinlock, so
initialize it earlier. Fixes a warning at boot with lock debugging
enabled.
Fixes: 6adb730dc208 ("watchdog: bcm281xx: Watchdog Driver")
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r-- | drivers/watchdog/bcm_kona_wdt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c index 6fce17d5b9f1..a5775dfd8d5f 100644 --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c @@ -304,6 +304,8 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev) if (!wdt) return -ENOMEM; + spin_lock_init(&wdt->lock); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); wdt->base = devm_ioremap_resource(dev, res); if (IS_ERR(wdt->base)) @@ -316,7 +318,6 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev) return ret; } - spin_lock_init(&wdt->lock); platform_set_drvdata(pdev, wdt); watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt); bcm_kona_wdt_wdd.parent = &pdev->dev; |