[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1606525206-22154-1-git-send-email-tiantao6@hisilicon.com>
Date: Sat, 28 Nov 2020 09:00:06 +0800
From: Tian Tao <tiantao6@...ilicon.com>
To: <kamil@...as.org>, <b.zolnierkie@...sung.com>, <jdelvare@...e.com>,
<linux@...ck-us.net>, <thierry.reding@...il.com>,
<u.kleine-koenig@...gutronix.de>, <lee.jones@...aro.org>,
<lgirdwood@...il.com>, <broonie@...nel.org>
CC: <linux-hwmon@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-pwm@...r.kernel.org>
Subject: [PATCH] hwmon: (pwm-fan): Switch to using the new API kobj_to_dev()
fixed the following coccicheck:
drivers/hwmon//pwm-fan.c:152:60-61: WARNING opportunity for kobj_to_dev().
Signed-off-by: Tian Tao <tiantao6@...ilicon.com>
---
drivers/hwmon/pwm-fan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 1f63807..7849011 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -149,7 +149,7 @@ static struct attribute *pwm_fan_attrs[] = {
static umode_t pwm_fan_attrs_visible(struct kobject *kobj, struct attribute *a,
int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct pwm_fan_ctx *ctx = dev_get_drvdata(dev);
/* Hide fan_input in case no interrupt is available */
--
2.7.4
Powered by blists - more mailing lists