Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: imx2_wdt: set watchdog parent device

If on watchdog device registration a parent device is not set, then
the registered watchdog is considered to be a virtual device:

/sys/devices/virtual/watchdog/watchdog0
/sys/devices/virtual/watchdog/watchdog1

Setting a correct reference to a platform device allows to
distinguish multiple instances of iMX2+ hardware watchdogs:

/sys/devices/soc0/soc/2000000.aips-bus/20bc000.wdog/watchdog/watchdog0
/sys/devices/soc0/soc/2000000.aips-bus/20c0000.wdog/watchdog/watchdog1

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Vladimir Zapolskiy and committed by
Wim Van Sebroeck
8135193c 57337db1

+1
+1
drivers/watchdog/imx2_wdt.c
··· 258 258 wdog->ops = &imx2_wdt_ops; 259 259 wdog->min_timeout = 1; 260 260 wdog->max_timeout = IMX2_WDT_MAX_TIME; 261 + wdog->parent = &pdev->dev; 261 262 262 263 clk_prepare_enable(wdev->clk); 263 264