SAM Watchdog: Register the watchdog device at the configured device path CONFIG_WATCHDOG_DEVPATH vs. hard-coded /dev/wdt

This commit is contained in:
Frank Benkert 2016-10-21 07:09:20 -06:00 committed by Gregory Nutt
parent 9438c42fff
commit cf5fdf1f8f
3 changed files with 11 additions and 5 deletions

View File

@ -695,7 +695,9 @@ void sam_wdtinitialize(FAR const char *devpath)
priv->window = priv->reload;
/* Register the watchdog driver as /dev/watchdog0 */
/* Register the watchdog driver, usually at CONFIG_WATCHDOG_DEVPATH
* (default /dev/watchdog0).
*/
(void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv);

View File

@ -687,9 +687,11 @@ int sam_wdt_initialize(void)
(void)irq_attach(SAM_IRQ_WDT, sam_interrupt);
#endif
/* Register the watchdog driver as /dev/watchdog0 */
/* Register the watchdog driver at the configured location (default
* /dev/watchdog0).
*/
(void)watchdog_register("/dev/watchdog0",
(void)watchdog_register(CONFIG_WATCHDOG_DEVPATH,
(FAR struct watchdog_lowerhalf_s *)priv);
return OK;
}

View File

@ -687,9 +687,11 @@ int sam_wdt_initialize(void)
(void)irq_attach(SAM_IRQ_WDT, sam_interrupt);
#endif
/* Register the watchdog driver as /dev/wdt */
/* Register the watchdog driver as device-node configured via .config.
* Normally /dev/watchdog0
*/
(void)watchdog_register("/dev/wdt",
(void)watchdog_register(CONFIG_WATCHDOG_DEVPATH,
(FAR struct watchdog_lowerhalf_s *)priv);
return OK;
}