aboutsummaryrefslogtreecommitdiff
path: root/drivers/watchdog/shwdt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 13:42:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 13:42:54 -0700
commit833e68340d108d88f4cb79b7d7223f6859d362ca (patch)
tree89f960431365ce2d47178c0620634b66979497fa /drivers/watchdog/shwdt.c
parentc55244137306b626bc64023fd7160985443205a7 (diff)
parentcce78da76601b64305c050f602767bf58cebcf5d (diff)
Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck: - lots of devm_ conversions and cleanup - platform_set_drvdata cleanups - s3c2410: dev_err/dev_info + dev_pm_ops - watchdog_core: don't try to stop device if not running fix - wdrtas: use print_hex_dump - xilinx cleanups - orion_wdt fixes - softdog cleanup - hpwdt: check on UEFI bits - deletion of mpcore_wdt driver - addition of broadcom BCM2835 watchdog timer driver - addition of MEN A21 watcdog devices * git://www.linux-watchdog.org/linux-watchdog: (38 commits) watchdog: hpwdt: Add check for UEFI bits watchdog: softdog: remove replaceable ping operation watchdog: New watchdog driver for MEN A21 watchdogs Watchdog: fix clearing of the watchdog interrupt Watchdog: allow orion_wdt to be built for Dove watchdog: Add Broadcom BCM2835 watchdog timer driver watchdog: delete mpcore_wdt driver watchdog: xilinx: Setup the origin compatible string watchdog: xilinx: Fix driver header watchdog: wdrtas: don't use custom version of print_hex_dump watchdog: core: don't try to stop device if not running watchdog: jz4740: Pass device to clk_get watchdog: twl4030: Remove redundant platform_set_drvdata() watchdog: mpcore: Remove redundant platform_set_drvdata() watchdog: da9055: use platform_{get,set}_drvdata() watchdog: da9052: use platform_{get,set}_drvdata() watchdog: cpwd: use platform_{get,set}_drvdata() watchdog: s3c2410_wdt: convert s3c2410wdt to dev_pm_ops watchdog: s3c2410_wdt: use dev_err()/dev_info() instead of pr_err()/pr_info() watchdog: wm831x: use platform_{get,set}_drvdata() ...
Diffstat (limited to 'drivers/watchdog/shwdt.c')
-rw-r--r--drivers/watchdog/shwdt.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
index 6185af2b3310..5bca79457768 100644
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -241,7 +241,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
wdt->dev = &pdev->dev;
- wdt->clk = clk_get(&pdev->dev, NULL);
+ wdt->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(wdt->clk)) {
/*
* Clock framework support is optional, continue on
@@ -251,10 +251,8 @@ static int sh_wdt_probe(struct platform_device *pdev)
}
wdt->base = devm_ioremap_resource(wdt->dev, res);
- if (IS_ERR(wdt->base)) {
- rc = PTR_ERR(wdt->base);
- goto err;
- }
+ if (IS_ERR(wdt->base))
+ return PTR_ERR(wdt->base);
watchdog_set_nowayout(&sh_wdt_dev, nowayout);
watchdog_set_drvdata(&sh_wdt_dev, wdt);
@@ -277,7 +275,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
rc = watchdog_register_device(&sh_wdt_dev);
if (unlikely(rc)) {
dev_err(&pdev->dev, "Can't register watchdog (err=%d)\n", rc);
- goto err;
+ return rc;
}
init_timer(&wdt->timer);
@@ -292,23 +290,15 @@ static int sh_wdt_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
return 0;
-
-err:
- clk_put(wdt->clk);
-
- return rc;
}
static int sh_wdt_remove(struct platform_device *pdev)
{
struct sh_wdt *wdt = platform_get_drvdata(pdev);
- platform_set_drvdata(pdev, NULL);
-
watchdog_unregister_device(&sh_wdt_dev);
pm_runtime_disable(&pdev->dev);
- clk_put(wdt->clk);
return 0;
}