Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: > /sys/class/watchdog/watchdogn/device/modalias can help to identify the > driver/module for a given watchdog node. However, many wdt devices does not > set > its 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, mpc8xxx, octeon, softdog and w83627hf -- They do > not > have any parent. Not sure, how we can we identify driver for these devices. > > Signed-off-by: Pratyush Anand > --- For the Wolfson parts: Acked-by: Charles Keepax Thanks, Charles -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: > /sys/class/watchdog/watchdogn/device/modalias can help to identify the > driver/module for a given watchdog node. However, many wdt devices does not > set > its 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, mpc8xxx, octeon, softdog and w83627hf -- They do > not > have any parent. Not sure, how we can we identify driver for these devices. > > Signed-off-by: Pratyush Anand> --- For the Wolfson parts: Acked-by: Charles Keepax Thanks, Charles -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH V3] Watchdog: Fix parent of watchdog_devices
> diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c > index 2bc0f5089f82..b346638833b0 100644 > --- a/drivers/misc/mei/wd.c > +++ b/drivers/misc/mei/wd.c > @@ -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(>device_lock); > ret = watchdog_register_device(_wd_dev); Acked-by: Tomas Winkler Should this be got to stable as well? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On August 19, 2015 04:28, Pratyush Anand wrote: > diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c > index 2e9589652e1e..67e67977bd29 100644 > --- a/drivers/watchdog/da9052_wdt.c > +++ b/drivers/watchdog/da9052_wdt.c > @@ -195,6 +195,7 @@ static int da9052_wdt_probe(struct platform_device *pdev) > da9052_wdt->timeout = DA9052_DEF_TIMEOUT; > da9052_wdt->info = _wdt_info; > da9052_wdt->ops = _wdt_ops; > + da9052_wdt->parent = >dev; > watchdog_set_drvdata(da9052_wdt, driver_data); > > kref_init(_data->kref); > diff --git a/drivers/watchdog/da9055_wdt.c b/drivers/watchdog/da9055_wdt.c > index 495089d8dbfe..04d1430d93d2 100644 > --- a/drivers/watchdog/da9055_wdt.c > +++ b/drivers/watchdog/da9055_wdt.c > @@ -161,6 +161,7 @@ static int da9055_wdt_probe(struct platform_device *pdev) > da9055_wdt->timeout = DA9055_DEF_TIMEOUT; > da9055_wdt->info = _wdt_info; > da9055_wdt->ops = _wdt_ops; > + da9055_wdt->parent = >dev; > watchdog_set_nowayout(da9055_wdt, nowayout); > watchdog_set_drvdata(da9055_wdt, driver_data); > > diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c > index b3a870ce85be..7386111220d5 100644 > --- a/drivers/watchdog/da9062_wdt.c > +++ b/drivers/watchdog/da9062_wdt.c > @@ -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 = >dev; > > watchdog_set_drvdata(>wdtdev, wdt); > dev_set_drvdata(>dev, wdt); > diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c > index e2fe2ebdebd4..6bf130bd863d 100644 > --- a/drivers/watchdog/da9063_wdt.c > +++ b/drivers/watchdog/da9063_wdt.c > @@ -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 = >dev; > > wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS; > Acked-by: Adam Thomson
RE: [PATCH V3] Watchdog: Fix parent of watchdog_devices
diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c index 2bc0f5089f82..b346638833b0 100644 --- a/drivers/misc/mei/wd.c +++ b/drivers/misc/mei/wd.c @@ -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); Acked-by: Tomas Winkler tomas.wink...@intel.com Should this be got to stable as well? -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On August 19, 2015 04:28, Pratyush Anand wrote: diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c index 2e9589652e1e..67e67977bd29 100644 --- a/drivers/watchdog/da9052_wdt.c +++ b/drivers/watchdog/da9052_wdt.c @@ -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); diff --git a/drivers/watchdog/da9055_wdt.c b/drivers/watchdog/da9055_wdt.c index 495089d8dbfe..04d1430d93d2 100644 --- a/drivers/watchdog/da9055_wdt.c +++ b/drivers/watchdog/da9055_wdt.c @@ -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); diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c index b3a870ce85be..7386111220d5 100644 --- a/drivers/watchdog/da9062_wdt.c +++ b/drivers/watchdog/da9062_wdt.c @@ -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); diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c index e2fe2ebdebd4..6bf130bd863d 100644 --- a/drivers/watchdog/da9063_wdt.c +++ b/drivers/watchdog/da9063_wdt.c @@ -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; Acked-by: Adam Thomson adam.thomson.opensou...@diasemi.com
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: > /sys/class/watchdog/watchdogn/device/modalias can help to identify the > driver/module for a given watchdog node. However, many wdt devices does not > set > its 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, mpc8xxx, octeon, softdog and w83627hf -- They do > not > have any parent. Not sure, how we can we identify driver for these devices. > If you happen to send out another revision, please reduce the number of columns in the description to 75 or less to avoid the checkpatch warning. Also, it would help if you can add all the Reviewed-by: and Acked-by: tags. > Signed-off-by: Pratyush Anand Passes my build and qemu tests, and the kbuild test robot is happy this time. Acked-by: Guenter Roeck Guenter > --- > Changes since v2: > Fixed drivers/watchdog/txx9wdt.c:134:20: error: 'pdev' undeclared > Reported-by: kbuild test robot > Changes since v1: > Squash all commits of V1 into a single patch. > V1 was here: > http://www.spinics.net/lists/linux-watchdog/msg07220.html > > drivers/misc/mei/wd.c | 1 + > drivers/watchdog/bcm2835_wdt.c | 1 + > drivers/watchdog/bcm47xx_wdt.c | 1 + > drivers/watchdog/bcm_kona_wdt.c | 1 + > drivers/watchdog/coh901327_wdt.c| 1 + > drivers/watchdog/da9052_wdt.c | 1 + > drivers/watchdog/da9055_wdt.c | 1 + > drivers/watchdog/da9062_wdt.c | 1 + > drivers/watchdog/da9063_wdt.c | 1 + > drivers/watchdog/davinci_wdt.c | 1 + > drivers/watchdog/digicolor_wdt.c| 1 + > drivers/watchdog/ep93xx_wdt.c | 1 + > drivers/watchdog/gpio_wdt.c | 1 + > drivers/watchdog/ie6xx_wdt.c| 1 + > drivers/watchdog/intel-mid_wdt.c| 1 + > drivers/watchdog/jz4740_wdt.c | 1 + > drivers/watchdog/mena21_wdt.c | 1 + > drivers/watchdog/menf21bmc_wdt.c| 1 + > drivers/watchdog/omap_wdt.c | 1 + > drivers/watchdog/orion_wdt.c| 1 + > drivers/watchdog/pnx4008_wdt.c | 1 + > drivers/watchdog/qcom-wdt.c | 1 + > drivers/watchdog/retu_wdt.c | 1 + > drivers/watchdog/rt2880_wdt.c | 1 + > drivers/watchdog/s3c2410_wdt.c | 1 + > drivers/watchdog/shwdt.c| 1 + > drivers/watchdog/sirfsoc_wdt.c | 1 + > drivers/watchdog/sp805_wdt.c| 1 + > drivers/watchdog/st_lpc_wdt.c | 1 + > drivers/watchdog/stmp3xxx_rtc_wdt.c | 1 + > drivers/watchdog/tegra_wdt.c| 1 + > drivers/watchdog/twl4030_wdt.c | 1 + > drivers/watchdog/txx9wdt.c | 1 + > drivers/watchdog/ux500_wdt.c| 1 + > drivers/watchdog/via_wdt.c | 1 + > drivers/watchdog/wm831x_wdt.c | 1 + > drivers/watchdog/wm8350_wdt.c | 1 + > 37 files changed, 37 insertions(+) > > diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c > index 2bc0f5089f82..b346638833b0 100644 > --- a/drivers/misc/mei/wd.c > +++ b/drivers/misc/mei/wd.c > @@ -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(>device_lock); > ret = watchdog_register_device(_wd_dev); > diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c > index 7116968dee12..66c3e656a616 100644 > --- a/drivers/watchdog/bcm2835_wdt.c > +++ b/drivers/watchdog/bcm2835_wdt.c > @@ -182,6 +182,7 @@ static int bcm2835_wdt_probe(struct platform_device *pdev) > watchdog_set_drvdata(_wdt_wdd, wdt); > watchdog_init_timeout(_wdt_wdd, heartbeat, dev); > watchdog_set_nowayout(_wdt_wdd, nowayout); > + bcm2835_wdt_wdd.parent = >dev; > err = watchdog_register_device(_wdt_wdd); > if (err) { > dev_err(dev, "Failed to register watchdog device"); > diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c > index b28a072abf78..4064a43f1360 100644 > --- a/drivers/watchdog/bcm47xx_wdt.c > +++ b/drivers/watchdog/bcm47xx_wdt.c > @@ -209,6 +209,7 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev) > > wdt->wdd.info = _wdt_info; > wdt->wdd.timeout = WDT_DEFAULT_TIME; > + wdt->wdd.parent = >dev; > ret = wdt->wdd.ops->set_timeout(>wdd, timeout); > if (ret) > goto err_timer; > diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c > index 22d8ae65772a..e0c98423f2c9 100644 > --- a/drivers/watchdog/bcm_kona_wdt.c > +++ b/drivers/watchdog/bcm_kona_wdt.c > @@ -319,6 +319,7 @@ static int bcm_kona_wdt_probe(struct platform_device > *pdev) > spin_lock_init(>lock); > platform_set_drvdata(pdev, wdt); > watchdog_set_drvdata(_kona_wdt_wdd, wdt); > + bcm_kona_wdt_wdd.parent = >dev; > > ret = bcm_kona_wdt_set_timeout_reg(_kona_wdt_wdd,
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
Hi Pratyush, On 08/19/2015 05:28 AM, Pratyush Anand wrote: diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c index 6785afdc0fca..14e9badf2bfa 100644 --- a/drivers/watchdog/st_lpc_wdt.c +++ b/drivers/watchdog/st_lpc_wdt.c @@ -241,6 +241,7 @@ static int st_wdog_probe(struct platform_device *pdev) return -EINVAL; } st_wdog_dev.max_timeout = 0x / st_wdog->clkrate; + st_wdog_dev.parent = >dev; ret = clk_prepare_enable(clk); if (ret) { Acked-by: Maxime Coquelin Thanks! Maxime -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: [...] > diff --git a/drivers/watchdog/tegra_wdt.c b/drivers/watchdog/tegra_wdt.c > index 30451ea46902..7f97cdd53f29 100644 > --- a/drivers/watchdog/tegra_wdt.c > +++ b/drivers/watchdog/tegra_wdt.c > @@ -218,6 +218,7 @@ static int tegra_wdt_probe(struct platform_device *pdev) > wdd->ops = _wdt_ops; > wdd->min_timeout = MIN_WDT_TIMEOUT; > wdd->max_timeout = MAX_WDT_TIMEOUT; > + wdd->parent = >dev; > > watchdog_set_drvdata(wdd, wdt); > Acked-by: Thierry Reding signature.asc Description: PGP signature
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
Hello, On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: > /sys/class/watchdog/watchdogn/device/modalias can help to identify the > driver/module for a given watchdog node. However, many wdt devices does not > set s/es// > its 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, mpc8xxx, octeon, softdog and w83627hf -- They do > not > have any parent. Not sure, how we can we identify driver for these devices. I don't see why you don't use the platform device as parent for mpc8xxx. Note however that I did several updates to the mpc8xxx driver which probably conflict with setting the parent. I'll take care of that. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | http://www.pengutronix.de/ | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: /sys/class/watchdog/watchdogn/device/modalias can help to identify the driver/module for a given watchdog node. However, many wdt devices does not set its 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, mpc8xxx, octeon, softdog and w83627hf -- They do not have any parent. Not sure, how we can we identify driver for these devices. If you happen to send out another revision, please reduce the number of columns in the description to 75 or less to avoid the checkpatch warning. Also, it would help if you can add all the Reviewed-by: and Acked-by: tags. Signed-off-by: Pratyush Anand pan...@redhat.com Passes my build and qemu tests, and the kbuild test robot is happy this time. Acked-by: Guenter Roeck li...@roeck-us.net Guenter --- Changes since v2: Fixed drivers/watchdog/txx9wdt.c:134:20: error: 'pdev' undeclared Reported-by: kbuild test robot fengguang...@intel.com Changes since v1: Squash all commits of V1 into a single patch. V1 was here: http://www.spinics.net/lists/linux-watchdog/msg07220.html drivers/misc/mei/wd.c | 1 + drivers/watchdog/bcm2835_wdt.c | 1 + drivers/watchdog/bcm47xx_wdt.c | 1 + drivers/watchdog/bcm_kona_wdt.c | 1 + drivers/watchdog/coh901327_wdt.c| 1 + drivers/watchdog/da9052_wdt.c | 1 + drivers/watchdog/da9055_wdt.c | 1 + drivers/watchdog/da9062_wdt.c | 1 + drivers/watchdog/da9063_wdt.c | 1 + drivers/watchdog/davinci_wdt.c | 1 + drivers/watchdog/digicolor_wdt.c| 1 + drivers/watchdog/ep93xx_wdt.c | 1 + drivers/watchdog/gpio_wdt.c | 1 + drivers/watchdog/ie6xx_wdt.c| 1 + drivers/watchdog/intel-mid_wdt.c| 1 + drivers/watchdog/jz4740_wdt.c | 1 + drivers/watchdog/mena21_wdt.c | 1 + drivers/watchdog/menf21bmc_wdt.c| 1 + drivers/watchdog/omap_wdt.c | 1 + drivers/watchdog/orion_wdt.c| 1 + drivers/watchdog/pnx4008_wdt.c | 1 + drivers/watchdog/qcom-wdt.c | 1 + drivers/watchdog/retu_wdt.c | 1 + drivers/watchdog/rt2880_wdt.c | 1 + drivers/watchdog/s3c2410_wdt.c | 1 + drivers/watchdog/shwdt.c| 1 + drivers/watchdog/sirfsoc_wdt.c | 1 + drivers/watchdog/sp805_wdt.c| 1 + drivers/watchdog/st_lpc_wdt.c | 1 + drivers/watchdog/stmp3xxx_rtc_wdt.c | 1 + drivers/watchdog/tegra_wdt.c| 1 + drivers/watchdog/twl4030_wdt.c | 1 + drivers/watchdog/txx9wdt.c | 1 + drivers/watchdog/ux500_wdt.c| 1 + drivers/watchdog/via_wdt.c | 1 + drivers/watchdog/wm831x_wdt.c | 1 + drivers/watchdog/wm8350_wdt.c | 1 + 37 files changed, 37 insertions(+) diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c index 2bc0f5089f82..b346638833b0 100644 --- a/drivers/misc/mei/wd.c +++ b/drivers/misc/mei/wd.c @@ -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); diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c index 7116968dee12..66c3e656a616 100644 --- a/drivers/watchdog/bcm2835_wdt.c +++ b/drivers/watchdog/bcm2835_wdt.c @@ -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); diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index b28a072abf78..4064a43f1360 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c @@ -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; diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c index 22d8ae65772a..e0c98423f2c9 100644 --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c @@ -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 =
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
Hi Pratyush, On 08/19/2015 05:28 AM, Pratyush Anand wrote: diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c index 6785afdc0fca..14e9badf2bfa 100644 --- a/drivers/watchdog/st_lpc_wdt.c +++ b/drivers/watchdog/st_lpc_wdt.c @@ -241,6 +241,7 @@ static int st_wdog_probe(struct platform_device *pdev) return -EINVAL; } st_wdog_dev.max_timeout = 0x / st_wdog-clkrate; + st_wdog_dev.parent = pdev-dev; ret = clk_prepare_enable(clk); if (ret) { Acked-by: Maxime Coquelin maxime.coque...@st.com Thanks! Maxime -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
Hello, On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: /sys/class/watchdog/watchdogn/device/modalias can help to identify the driver/module for a given watchdog node. However, many wdt devices does not set s/es// its 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, mpc8xxx, octeon, softdog and w83627hf -- They do not have any parent. Not sure, how we can we identify driver for these devices. I don't see why you don't use the platform device as parent for mpc8xxx. Note however that I did several updates to the mpc8xxx driver which probably conflict with setting the parent. I'll take care of that. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | http://www.pengutronix.de/ | -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH V3] Watchdog: Fix parent of watchdog_devices
On Wed, Aug 19, 2015 at 08:58:24AM +0530, Pratyush Anand wrote: [...] diff --git a/drivers/watchdog/tegra_wdt.c b/drivers/watchdog/tegra_wdt.c index 30451ea46902..7f97cdd53f29 100644 --- a/drivers/watchdog/tegra_wdt.c +++ b/drivers/watchdog/tegra_wdt.c @@ -218,6 +218,7 @@ static int tegra_wdt_probe(struct platform_device *pdev) wdd-ops = tegra_wdt_ops; wdd-min_timeout = MIN_WDT_TIMEOUT; wdd-max_timeout = MAX_WDT_TIMEOUT; + wdd-parent = pdev-dev; watchdog_set_drvdata(wdd, wdt); Acked-by: Thierry Reding tred...@nvidia.com signature.asc Description: PGP signature
[PATCH V3] 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 does not set its 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, mpc8xxx, octeon, softdog and w83627hf -- They do not have any parent. Not sure, how we can we identify driver for these devices. Signed-off-by: Pratyush Anand --- Changes since v2: Fixed drivers/watchdog/txx9wdt.c:134:20: error: 'pdev' undeclared Reported-by: kbuild test robot Changes since v1: Squash all commits of V1 into a single patch. V1 was here: http://www.spinics.net/lists/linux-watchdog/msg07220.html drivers/misc/mei/wd.c | 1 + drivers/watchdog/bcm2835_wdt.c | 1 + drivers/watchdog/bcm47xx_wdt.c | 1 + drivers/watchdog/bcm_kona_wdt.c | 1 + drivers/watchdog/coh901327_wdt.c| 1 + drivers/watchdog/da9052_wdt.c | 1 + drivers/watchdog/da9055_wdt.c | 1 + drivers/watchdog/da9062_wdt.c | 1 + drivers/watchdog/da9063_wdt.c | 1 + drivers/watchdog/davinci_wdt.c | 1 + drivers/watchdog/digicolor_wdt.c| 1 + drivers/watchdog/ep93xx_wdt.c | 1 + drivers/watchdog/gpio_wdt.c | 1 + drivers/watchdog/ie6xx_wdt.c| 1 + drivers/watchdog/intel-mid_wdt.c| 1 + drivers/watchdog/jz4740_wdt.c | 1 + drivers/watchdog/mena21_wdt.c | 1 + drivers/watchdog/menf21bmc_wdt.c| 1 + drivers/watchdog/omap_wdt.c | 1 + drivers/watchdog/orion_wdt.c| 1 + drivers/watchdog/pnx4008_wdt.c | 1 + drivers/watchdog/qcom-wdt.c | 1 + drivers/watchdog/retu_wdt.c | 1 + drivers/watchdog/rt2880_wdt.c | 1 + drivers/watchdog/s3c2410_wdt.c | 1 + drivers/watchdog/shwdt.c| 1 + drivers/watchdog/sirfsoc_wdt.c | 1 + drivers/watchdog/sp805_wdt.c| 1 + drivers/watchdog/st_lpc_wdt.c | 1 + drivers/watchdog/stmp3xxx_rtc_wdt.c | 1 + drivers/watchdog/tegra_wdt.c| 1 + drivers/watchdog/twl4030_wdt.c | 1 + drivers/watchdog/txx9wdt.c | 1 + drivers/watchdog/ux500_wdt.c| 1 + drivers/watchdog/via_wdt.c | 1 + drivers/watchdog/wm831x_wdt.c | 1 + drivers/watchdog/wm8350_wdt.c | 1 + 37 files changed, 37 insertions(+) diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c index 2bc0f5089f82..b346638833b0 100644 --- a/drivers/misc/mei/wd.c +++ b/drivers/misc/mei/wd.c @@ -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(>device_lock); ret = watchdog_register_device(_wd_dev); diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c index 7116968dee12..66c3e656a616 100644 --- a/drivers/watchdog/bcm2835_wdt.c +++ b/drivers/watchdog/bcm2835_wdt.c @@ -182,6 +182,7 @@ static int bcm2835_wdt_probe(struct platform_device *pdev) watchdog_set_drvdata(_wdt_wdd, wdt); watchdog_init_timeout(_wdt_wdd, heartbeat, dev); watchdog_set_nowayout(_wdt_wdd, nowayout); + bcm2835_wdt_wdd.parent = >dev; err = watchdog_register_device(_wdt_wdd); if (err) { dev_err(dev, "Failed to register watchdog device"); diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index b28a072abf78..4064a43f1360 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c @@ -209,6 +209,7 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev) wdt->wdd.info = _wdt_info; wdt->wdd.timeout = WDT_DEFAULT_TIME; + wdt->wdd.parent = >dev; ret = wdt->wdd.ops->set_timeout(>wdd, timeout); if (ret) goto err_timer; diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c index 22d8ae65772a..e0c98423f2c9 100644 --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c @@ -319,6 +319,7 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev) spin_lock_init(>lock); platform_set_drvdata(pdev, wdt); watchdog_set_drvdata(_kona_wdt_wdd, wdt); + bcm_kona_wdt_wdd.parent = >dev; ret = bcm_kona_wdt_set_timeout_reg(_kona_wdt_wdd, 0); if (ret) { diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c index ce12f437f195..a099b77fc0b9 100644 --- a/drivers/watchdog/coh901327_wdt.c +++ b/drivers/watchdog/coh901327_wdt.c @@ -358,6 +358,7 @@ static int __init coh901327_probe(struct platform_device *pdev) if (ret < 0) coh901327_wdt.timeout = 60; + coh901327_wdt.parent = >dev; ret = watchdog_register_device(_wdt); if (ret == 0) dev_info(>dev, diff --git a/drivers/watchdog/da9052_wdt.c
[PATCH V3] 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 does not set its 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, mpc8xxx, octeon, softdog and w83627hf -- They do not have any parent. Not sure, how we can we identify driver for these devices. Signed-off-by: Pratyush Anand pan...@redhat.com --- Changes since v2: Fixed drivers/watchdog/txx9wdt.c:134:20: error: 'pdev' undeclared Reported-by: kbuild test robot fengguang...@intel.com Changes since v1: Squash all commits of V1 into a single patch. V1 was here: http://www.spinics.net/lists/linux-watchdog/msg07220.html drivers/misc/mei/wd.c | 1 + drivers/watchdog/bcm2835_wdt.c | 1 + drivers/watchdog/bcm47xx_wdt.c | 1 + drivers/watchdog/bcm_kona_wdt.c | 1 + drivers/watchdog/coh901327_wdt.c| 1 + drivers/watchdog/da9052_wdt.c | 1 + drivers/watchdog/da9055_wdt.c | 1 + drivers/watchdog/da9062_wdt.c | 1 + drivers/watchdog/da9063_wdt.c | 1 + drivers/watchdog/davinci_wdt.c | 1 + drivers/watchdog/digicolor_wdt.c| 1 + drivers/watchdog/ep93xx_wdt.c | 1 + drivers/watchdog/gpio_wdt.c | 1 + drivers/watchdog/ie6xx_wdt.c| 1 + drivers/watchdog/intel-mid_wdt.c| 1 + drivers/watchdog/jz4740_wdt.c | 1 + drivers/watchdog/mena21_wdt.c | 1 + drivers/watchdog/menf21bmc_wdt.c| 1 + drivers/watchdog/omap_wdt.c | 1 + drivers/watchdog/orion_wdt.c| 1 + drivers/watchdog/pnx4008_wdt.c | 1 + drivers/watchdog/qcom-wdt.c | 1 + drivers/watchdog/retu_wdt.c | 1 + drivers/watchdog/rt2880_wdt.c | 1 + drivers/watchdog/s3c2410_wdt.c | 1 + drivers/watchdog/shwdt.c| 1 + drivers/watchdog/sirfsoc_wdt.c | 1 + drivers/watchdog/sp805_wdt.c| 1 + drivers/watchdog/st_lpc_wdt.c | 1 + drivers/watchdog/stmp3xxx_rtc_wdt.c | 1 + drivers/watchdog/tegra_wdt.c| 1 + drivers/watchdog/twl4030_wdt.c | 1 + drivers/watchdog/txx9wdt.c | 1 + drivers/watchdog/ux500_wdt.c| 1 + drivers/watchdog/via_wdt.c | 1 + drivers/watchdog/wm831x_wdt.c | 1 + drivers/watchdog/wm8350_wdt.c | 1 + 37 files changed, 37 insertions(+) diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c index 2bc0f5089f82..b346638833b0 100644 --- a/drivers/misc/mei/wd.c +++ b/drivers/misc/mei/wd.c @@ -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); diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c index 7116968dee12..66c3e656a616 100644 --- a/drivers/watchdog/bcm2835_wdt.c +++ b/drivers/watchdog/bcm2835_wdt.c @@ -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); diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index b28a072abf78..4064a43f1360 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c @@ -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; diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c index 22d8ae65772a..e0c98423f2c9 100644 --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c @@ -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) { diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c index ce12f437f195..a099b77fc0b9 100644 --- a/drivers/watchdog/coh901327_wdt.c +++ b/drivers/watchdog/coh901327_wdt.c @@ -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