mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Watchdog: Fix parent of watchdog_devices
/sys/class/watchdog/watchdogn/device/modalias can help to identify the driver/module for a given watchdog node. However, many wdt devices do not set their parent and so, we do not see an entry for device in sysfs for such devices. This patch fixes parent of watchdog_device so that /sys/class/watchdog/watchdogn/device is populated. Exceptions: booke, diag288, octeon, softdog and w83627hf -- They do not have any parent. Not sure, how we can identify driver for these devices. Signed-off-by: Pratyush Anand <panand@redhat.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
committed by
Wim Van Sebroeck
parent
bf5125d5e0
commit
6551881c86
@@ -364,6 +364,7 @@ int mei_watchdog_register(struct mei_device *dev)
|
||||
|
||||
int ret;
|
||||
|
||||
amt_wd_dev.parent = dev->dev;
|
||||
/* unlock to perserve correct locking order */
|
||||
mutex_unlock(&dev->device_lock);
|
||||
ret = watchdog_register_device(&amt_wd_dev);
|
||||
|
||||
@@ -182,6 +182,7 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
|
||||
watchdog_set_drvdata(&bcm2835_wdt_wdd, wdt);
|
||||
watchdog_init_timeout(&bcm2835_wdt_wdd, heartbeat, dev);
|
||||
watchdog_set_nowayout(&bcm2835_wdt_wdd, nowayout);
|
||||
bcm2835_wdt_wdd.parent = &pdev->dev;
|
||||
err = watchdog_register_device(&bcm2835_wdt_wdd);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to register watchdog device");
|
||||
|
||||
@@ -209,6 +209,7 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev)
|
||||
|
||||
wdt->wdd.info = &bcm47xx_wdt_info;
|
||||
wdt->wdd.timeout = WDT_DEFAULT_TIME;
|
||||
wdt->wdd.parent = &pdev->dev;
|
||||
ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout);
|
||||
if (ret)
|
||||
goto err_timer;
|
||||
|
||||
@@ -319,6 +319,7 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
|
||||
spin_lock_init(&wdt->lock);
|
||||
platform_set_drvdata(pdev, wdt);
|
||||
watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt);
|
||||
bcm_kona_wdt_wdd.parent = &pdev->dev;
|
||||
|
||||
ret = bcm_kona_wdt_set_timeout_reg(&bcm_kona_wdt_wdd, 0);
|
||||
if (ret) {
|
||||
|
||||
@@ -358,6 +358,7 @@ static int __init coh901327_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
coh901327_wdt.timeout = 60;
|
||||
|
||||
coh901327_wdt.parent = &pdev->dev;
|
||||
ret = watchdog_register_device(&coh901327_wdt);
|
||||
if (ret == 0)
|
||||
dev_info(&pdev->dev,
|
||||
|
||||
@@ -195,6 +195,7 @@ static int da9052_wdt_probe(struct platform_device *pdev)
|
||||
da9052_wdt->timeout = DA9052_DEF_TIMEOUT;
|
||||
da9052_wdt->info = &da9052_wdt_info;
|
||||
da9052_wdt->ops = &da9052_wdt_ops;
|
||||
da9052_wdt->parent = &pdev->dev;
|
||||
watchdog_set_drvdata(da9052_wdt, driver_data);
|
||||
|
||||
kref_init(&driver_data->kref);
|
||||
|
||||
@@ -161,6 +161,7 @@ static int da9055_wdt_probe(struct platform_device *pdev)
|
||||
da9055_wdt->timeout = DA9055_DEF_TIMEOUT;
|
||||
da9055_wdt->info = &da9055_wdt_info;
|
||||
da9055_wdt->ops = &da9055_wdt_ops;
|
||||
da9055_wdt->parent = &pdev->dev;
|
||||
watchdog_set_nowayout(da9055_wdt, nowayout);
|
||||
watchdog_set_drvdata(da9055_wdt, driver_data);
|
||||
|
||||
|
||||
@@ -210,6 +210,7 @@ static int da9062_wdt_probe(struct platform_device *pdev)
|
||||
wdt->wdtdev.max_timeout = DA9062_WDT_MAX_TIMEOUT;
|
||||
wdt->wdtdev.timeout = DA9062_WDG_DEFAULT_TIMEOUT;
|
||||
wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
|
||||
wdt->wdtdev.parent = &pdev->dev;
|
||||
|
||||
watchdog_set_drvdata(&wdt->wdtdev, wdt);
|
||||
dev_set_drvdata(&pdev->dev, wdt);
|
||||
|
||||
@@ -175,6 +175,7 @@ static int da9063_wdt_probe(struct platform_device *pdev)
|
||||
wdt->wdtdev.min_timeout = DA9063_WDT_MIN_TIMEOUT;
|
||||
wdt->wdtdev.max_timeout = DA9063_WDT_MAX_TIMEOUT;
|
||||
wdt->wdtdev.timeout = DA9063_WDG_TIMEOUT;
|
||||
wdt->wdtdev.parent = &pdev->dev;
|
||||
|
||||
wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@ static int davinci_wdt_probe(struct platform_device *pdev)
|
||||
wdd->min_timeout = 1;
|
||||
wdd->max_timeout = MAX_HEARTBEAT;
|
||||
wdd->timeout = DEFAULT_HEARTBEAT;
|
||||
wdd->parent = &pdev->dev;
|
||||
|
||||
watchdog_init_timeout(wdd, heartbeat, dev);
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ static int dc_wdt_probe(struct platform_device *pdev)
|
||||
}
|
||||
dc_wdt_wdd.max_timeout = U32_MAX / clk_get_rate(wdt->clk);
|
||||
dc_wdt_wdd.timeout = dc_wdt_wdd.max_timeout;
|
||||
dc_wdt_wdd.parent = &pdev->dev;
|
||||
|
||||
spin_lock_init(&wdt->lock);
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ static int ep93xx_wdt_probe(struct platform_device *pdev)
|
||||
val = readl(mmio_base + EP93XX_WATCHDOG);
|
||||
ep93xx_wdt_wdd.bootstatus = (val & 0x01) ? WDIOF_CARDRESET : 0;
|
||||
ep93xx_wdt_wdd.timeout = timeout;
|
||||
ep93xx_wdt_wdd.parent = &pdev->dev;
|
||||
|
||||
watchdog_set_nowayout(&ep93xx_wdt_wdd, nowayout);
|
||||
|
||||
|
||||
@@ -217,6 +217,7 @@ static int gpio_wdt_probe(struct platform_device *pdev)
|
||||
priv->wdd.ops = &gpio_wdt_ops;
|
||||
priv->wdd.min_timeout = SOFT_TIMEOUT_MIN;
|
||||
priv->wdd.max_timeout = SOFT_TIMEOUT_MAX;
|
||||
priv->wdd.parent = &pdev->dev;
|
||||
|
||||
if (watchdog_init_timeout(&priv->wdd, 0, &pdev->dev) < 0)
|
||||
priv->wdd.timeout = SOFT_TIMEOUT_DEF;
|
||||
|
||||
@@ -267,6 +267,7 @@ static int ie6xx_wdt_probe(struct platform_device *pdev)
|
||||
|
||||
ie6xx_wdt_dev.timeout = timeout;
|
||||
watchdog_set_nowayout(&ie6xx_wdt_dev, nowayout);
|
||||
ie6xx_wdt_dev.parent = &pdev->dev;
|
||||
|
||||
spin_lock_init(&ie6xx_wdt_data.unlock_sequence);
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ static int mid_wdt_probe(struct platform_device *pdev)
|
||||
wdt_dev->min_timeout = MID_WDT_TIMEOUT_MIN;
|
||||
wdt_dev->max_timeout = MID_WDT_TIMEOUT_MAX;
|
||||
wdt_dev->timeout = MID_WDT_DEFAULT_TIMEOUT;
|
||||
wdt_dev->parent = &pdev->dev;
|
||||
|
||||
watchdog_set_drvdata(wdt_dev, &pdev->dev);
|
||||
platform_set_drvdata(pdev, wdt_dev);
|
||||
|
||||
@@ -174,6 +174,7 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
|
||||
jz4740_wdt->timeout = heartbeat;
|
||||
jz4740_wdt->min_timeout = 1;
|
||||
jz4740_wdt->max_timeout = MAX_HEARTBEAT;
|
||||
jz4740_wdt->parent = &pdev->dev;
|
||||
watchdog_set_nowayout(jz4740_wdt, nowayout);
|
||||
watchdog_set_drvdata(jz4740_wdt, drvdata);
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ static int a21_wdt_probe(struct platform_device *pdev)
|
||||
watchdog_init_timeout(&a21_wdt, 30, &pdev->dev);
|
||||
watchdog_set_nowayout(&a21_wdt, nowayout);
|
||||
watchdog_set_drvdata(&a21_wdt, drv);
|
||||
a21_wdt.parent = &pdev->dev;
|
||||
|
||||
reset = a21_wdt_get_bootstatus(drv);
|
||||
if (reset == 2)
|
||||
|
||||
@@ -130,6 +130,7 @@ static int menf21bmc_wdt_probe(struct platform_device *pdev)
|
||||
drv_data->wdt.info = &menf21bmc_wdt_info;
|
||||
drv_data->wdt.min_timeout = BMC_WD_TIMEOUT_MIN;
|
||||
drv_data->wdt.max_timeout = BMC_WD_TIMEOUT_MAX;
|
||||
drv_data->wdt.parent = &pdev->dev;
|
||||
drv_data->i2c_client = i2c_client;
|
||||
|
||||
/*
|
||||
|
||||
@@ -253,6 +253,7 @@ static int omap_wdt_probe(struct platform_device *pdev)
|
||||
wdev->wdog.ops = &omap_wdt_ops;
|
||||
wdev->wdog.min_timeout = TIMER_MARGIN_MIN;
|
||||
wdev->wdog.max_timeout = TIMER_MARGIN_MAX;
|
||||
wdev->wdog.parent = &pdev->dev;
|
||||
|
||||
if (watchdog_init_timeout(&wdev->wdog, timer_margin, &pdev->dev) < 0)
|
||||
wdev->wdog.timeout = TIMER_MARGIN_DEFAULT;
|
||||
|
||||
@@ -567,6 +567,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
|
||||
|
||||
dev->wdt.timeout = wdt_max_duration;
|
||||
dev->wdt.max_timeout = wdt_max_duration;
|
||||
dev->wdt.parent = &pdev->dev;
|
||||
watchdog_init_timeout(&dev->wdt, heartbeat, &pdev->dev);
|
||||
|
||||
platform_set_drvdata(pdev, &dev->wdt);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user