* [PATCH] hwmon: (da9052): Switch to using the new API kobj_to_dev()
@ 2021-02-09 8:43 Tian Tao
2021-02-12 4:29 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2021-02-09 8:43 UTC (permalink / raw)
To: jdelvare, linux; +Cc: linux-hwmon
Switch to using the new API kobj_to_dev() to fix the below warnning:
/drivers/hwmon/da9052-hwmon.c:302:60-61: WARNING opportunity for
kobj_to_dev().
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/hwmon/da9052-hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/da9052-hwmon.c b/drivers/hwmon/da9052-hwmon.c
index 4af2fc3..ed6c5df 100644
--- a/drivers/hwmon/da9052-hwmon.c
+++ b/drivers/hwmon/da9052-hwmon.c
@@ -299,7 +299,7 @@ static ssize_t label_show(struct device *dev,
static umode_t da9052_channel_is_visible(struct kobject *kobj,
struct attribute *attr, int index)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct da9052_hwmon *hwmon = dev_get_drvdata(dev);
struct device_attribute *dattr = container_of(attr,
struct device_attribute, attr);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: (da9052): Switch to using the new API kobj_to_dev()
2021-02-09 8:43 [PATCH] hwmon: (da9052): Switch to using the new API kobj_to_dev() Tian Tao
@ 2021-02-12 4:29 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-02-12 4:29 UTC (permalink / raw)
To: Tian Tao; +Cc: jdelvare, linux-hwmon
On Tue, Feb 09, 2021 at 04:43:28PM +0800, Tian Tao wrote:
> Switch to using the new API kobj_to_dev() to fix the below warnning:
> /drivers/hwmon/da9052-hwmon.c:302:60-61: WARNING opportunity for
> kobj_to_dev().
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/da9052-hwmon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/da9052-hwmon.c b/drivers/hwmon/da9052-hwmon.c
> index 4af2fc3..ed6c5df 100644
> --- a/drivers/hwmon/da9052-hwmon.c
> +++ b/drivers/hwmon/da9052-hwmon.c
> @@ -299,7 +299,7 @@ static ssize_t label_show(struct device *dev,
> static umode_t da9052_channel_is_visible(struct kobject *kobj,
> struct attribute *attr, int index)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct da9052_hwmon *hwmon = dev_get_drvdata(dev);
> struct device_attribute *dattr = container_of(attr,
> struct device_attribute, attr);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-12 4:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 8:43 [PATCH] hwmon: (da9052): Switch to using the new API kobj_to_dev() Tian Tao
2021-02-12 4:29 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.