1
0
Fork 0

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>
hifive-unleashed-5.1
Vladimir Zapolskiy 2015-06-02 15:46:18 +03:00 committed by Wim Van Sebroeck
parent 57337db1b9
commit 8135193ceb
1 changed files with 1 additions and 0 deletions

View File

@ -258,6 +258,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
wdog->ops = &imx2_wdt_ops;
wdog->min_timeout = 1;
wdog->max_timeout = IMX2_WDT_MAX_TIME;
wdog->parent = &pdev->dev;
clk_prepare_enable(wdev->clk);