Commit b9e6dd56 authored by Eric Anholt's avatar Eric Anholt Committed by Ben Hutchings

watchdog: bcm281xx: Fix use of uninitialized spinlock.

commit fedf266f upstream.

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: 6adb730d ("watchdog: bcm281xx: Watchdog Driver")
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent c0d3505c
...@@ -299,6 +299,8 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev) ...@@ -299,6 +299,8 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
if (!wdt) if (!wdt)
return -ENOMEM; return -ENOMEM;
spin_lock_init(&wdt->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
wdt->base = devm_ioremap_resource(dev, res); wdt->base = devm_ioremap_resource(dev, res);
if (IS_ERR(wdt->base)) if (IS_ERR(wdt->base))
...@@ -311,7 +313,6 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev) ...@@ -311,7 +313,6 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
return ret; return ret;
} }
spin_lock_init(&wdt->lock);
platform_set_drvdata(pdev, wdt); platform_set_drvdata(pdev, wdt);
watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt); watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment