* [PATCH] drivers\watchdog: Use kobj_to_dev() API
@ 2020-06-12 7:03 Wang Qing
2020-06-12 13:17 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-06-12 7:03 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel; +Cc: Wang Qing
Use kobj_to_dev() API instead of container_of().
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
drivers/watchdog/watchdog_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
mode change 100644 => 100755 drivers/watchdog/watchdog_dev.c
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 7e4cd34..9da2360
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -587,7 +587,7 @@ static DEVICE_ATTR_RW(pretimeout_governor);
static umode_t wdt_is_visible(struct kobject *kobj, struct attribute *attr,
int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct watchdog_device *wdd = dev_get_drvdata(dev);
umode_t mode = attr->mode;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers\watchdog: Use kobj_to_dev() API
2020-06-12 7:03 [PATCH] drivers\watchdog: Use kobj_to_dev() API Wang Qing
@ 2020-06-12 13:17 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-06-12 13:17 UTC (permalink / raw)
To: Wang Qing, Wim Van Sebroeck, linux-watchdog, linux-kernel
On 6/12/20 12:03 AM, Wang Qing wrote:
> Use kobj_to_dev() API instead of container_of().
>
> Signed-off-by: Wang Qing <wangqing@vivo.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/watchdog_dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> mode change 100644 => 100755 drivers/watchdog/watchdog_dev.c
>
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index 7e4cd34..9da2360
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -587,7 +587,7 @@ static DEVICE_ATTR_RW(pretimeout_governor);
> static umode_t wdt_is_visible(struct kobject *kobj, struct attribute *attr,
> int n)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct watchdog_device *wdd = dev_get_drvdata(dev);
> umode_t mode = attr->mode;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-12 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 7:03 [PATCH] drivers\watchdog: Use kobj_to_dev() API Wang Qing
2020-06-12 13:17 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).