diff options
author | Linus Torvalds | 2019-05-13 15:20:42 +0200 |
---|---|---|
committer | Linus Torvalds | 2019-05-13 15:20:42 +0200 |
commit | 55472bae5331f33582d9f0e8919fed8bebcda0da (patch) | |
tree | 4e9d910e8f5de08d1ceb45509ff42641fcd0a6e7 /drivers/watchdog/mena21_wdt.c | |
parent | Merge tag 'upstream-5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kerne... (diff) | |
parent | watchdog: Enforce that at least one pretimeout governor is enabled (diff) | |
download | kernel-qcow2-linux-55472bae5331f33582d9f0e8919fed8bebcda0da.tar.gz kernel-qcow2-linux-55472bae5331f33582d9f0e8919fed8bebcda0da.tar.xz kernel-qcow2-linux-55472bae5331f33582d9f0e8919fed8bebcda0da.zip |
Merge tag 'linux-watchdog-5.2-rc1' of git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck:
- a new watchdog driver for the ROHM BD70528 watchdog block
- a new watchdog driver for the i.MX system controller watchdog
- conversions to use device managed functions and other improvements
- refactor watchdog_init_timeout
- make watchdog core configurable as module
- pretimeout governors improvements
- a lot of other fixes
* tag 'linux-watchdog-5.2-rc1' of git://www.linux-watchdog.org/linux-watchdog: (114 commits)
watchdog: Enforce that at least one pretimeout governor is enabled
watchdog: stm32: add dynamic prescaler support
watchdog: Improve Kconfig entry ordering and dependencies
watchdog: npcm: Enable modular builds
watchdog: Make watchdog core configurable as module
watchdog: Move pretimeout governor configuration up
watchdog: Use depends instead of select for pretimeout governors
watchdog: rtd119x: drop unused module.h include
watchdog: intel_scu: make it explicitly non-modular
watchdog: coh901327: make it explicitly non-modular
watchdog: ziirave_wdt: drop warning after calling watchdog_init_timeout
watchdog: xen_wdt: drop warning after calling watchdog_init_timeout
watchdog: stm32_iwdg: drop warning after calling watchdog_init_timeout
watchdog: st_lpc_wdt: drop warning after calling watchdog_init_timeout
watchdog: sp5100_tco: drop warning after calling watchdog_init_timeout
watchdog: renesas_wdt: drop warning after calling watchdog_init_timeout
watchdog: nic7018_wdt: drop warning after calling watchdog_init_timeout
watchdog: ni903x_wdt: drop warning after calling watchdog_init_timeout
watchdog: imx_sc_wdt: drop warning after calling watchdog_init_timeout
watchdog: i6300esb: drop warning after calling watchdog_init_timeout
...
Diffstat (limited to 'drivers/watchdog/mena21_wdt.c')
-rw-r--r-- | drivers/watchdog/mena21_wdt.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/watchdog/mena21_wdt.c b/drivers/watchdog/mena21_wdt.c index 6db69883ece6..e9ca4e0e25dc 100644 --- a/drivers/watchdog/mena21_wdt.c +++ b/drivers/watchdog/mena21_wdt.c @@ -127,19 +127,20 @@ static struct watchdog_device a21_wdt = { static int a21_wdt_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct a21_wdt_drv *drv; unsigned int reset = 0; int num_gpios; int ret; int i; - drv = devm_kzalloc(&pdev->dev, sizeof(struct a21_wdt_drv), GFP_KERNEL); + drv = devm_kzalloc(dev, sizeof(struct a21_wdt_drv), GFP_KERNEL); if (!drv) return -ENOMEM; - num_gpios = gpiod_count(&pdev->dev, NULL); + num_gpios = gpiod_count(dev, NULL); if (num_gpios != NUM_GPIOS) { - dev_err(&pdev->dev, "gpios DT property wrong, got %d want %d", + dev_err(dev, "gpios DT property wrong, got %d want %d", num_gpios, NUM_GPIOS); return -ENODEV; } @@ -152,12 +153,9 @@ static int a21_wdt_probe(struct platform_device *pdev) gflags = GPIOD_ASIS; else gflags = GPIOD_IN; - drv->gpios[i] = devm_gpiod_get_index(&pdev->dev, NULL, i, - gflags); - if (IS_ERR(drv->gpios[i])) { - ret = PTR_ERR(drv->gpios[i]); - return ret; - } + drv->gpios[i] = devm_gpiod_get_index(dev, NULL, i, gflags); + if (IS_ERR(drv->gpios[i])) + return PTR_ERR(drv->gpios[i]); gpiod_set_consumer_name(drv->gpios[i], "MEN A21 Watchdog"); @@ -173,10 +171,10 @@ static int a21_wdt_probe(struct platform_device *pdev) } } - watchdog_init_timeout(&a21_wdt, 30, &pdev->dev); + watchdog_init_timeout(&a21_wdt, 30, dev); watchdog_set_nowayout(&a21_wdt, nowayout); watchdog_set_drvdata(&a21_wdt, drv); - a21_wdt.parent = &pdev->dev; + a21_wdt.parent = dev; reset = a21_wdt_get_bootstatus(drv); if (reset == 2) @@ -189,15 +187,15 @@ static int a21_wdt_probe(struct platform_device *pdev) a21_wdt.bootstatus |= WDIOF_EXTERN2; drv->wdt = a21_wdt; - dev_set_drvdata(&pdev->dev, drv); + dev_set_drvdata(dev, drv); - ret = devm_watchdog_register_device(&pdev->dev, &a21_wdt); + ret = devm_watchdog_register_device(dev, &a21_wdt); if (ret) { - dev_err(&pdev->dev, "Cannot register watchdog device\n"); + dev_err(dev, "Cannot register watchdog device\n"); return ret; } - dev_info(&pdev->dev, "MEN A21 watchdog timer driver enabled\n"); + dev_info(dev, "MEN A21 watchdog timer driver enabled\n"); return 0; } |