summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-01-04 05:05:45 +0300
committerGuenter Roeck <linux@roeck-us.net>2021-01-28 04:44:18 +0300
commitda75b2245281ec28b74117f6da219405464928be (patch)
tree579b5b08db10964f05e1f11bdef49efcc5b7dde7
parentf1fc688c65fd3abe058420c785276c81d4a9c66e (diff)
downloadlinux-da75b2245281ec28b74117f6da219405464928be.tar.xz
hwmon: (aspeed-pwm-tacho) Switch to using the new API kobj_to_dev()
fixed the following coccicheck: drivers/hwmon/aspeed-pwm-tacho.c:634:60-61: WARNING opportunity for kobj_to_dev() drivers/hwmon/aspeed-pwm-tacho.c:623:60-61: WARNING opportunity for kobj_to_dev() Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Acked-by: Joel Stanley <joel@jms.id.au> Link: https://lore.kernel.org/r/1609725945-13895-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/aspeed-pwm-tacho.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
index 3d8239fd66ed..3cb88d6fbec0 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -620,7 +620,7 @@ static ssize_t rpm_show(struct device *dev, struct device_attribute *attr,
static umode_t pwm_is_visible(struct kobject *kobj,
struct attribute *a, int index)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
if (!priv->pwm_present[index])
@@ -631,7 +631,7 @@ static umode_t pwm_is_visible(struct kobject *kobj,
static umode_t fan_dev_is_visible(struct kobject *kobj,
struct attribute *a, int index)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
if (!priv->fan_tach_present[index])