Commit da75b224 authored by Tian Tao's avatar Tian Tao Committed by Guenter Roeck

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: default avatarTian Tao <tiantao6@hisilicon.com>
Acked-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/1609725945-13895-1-git-send-email-tiantao6@hisilicon.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent f1fc688c
...@@ -620,7 +620,7 @@ static ssize_t rpm_show(struct device *dev, struct device_attribute *attr, ...@@ -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, static umode_t pwm_is_visible(struct kobject *kobj,
struct attribute *a, int index) 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); struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
if (!priv->pwm_present[index]) if (!priv->pwm_present[index])
...@@ -631,7 +631,7 @@ static umode_t pwm_is_visible(struct kobject *kobj, ...@@ -631,7 +631,7 @@ static umode_t pwm_is_visible(struct kobject *kobj,
static umode_t fan_dev_is_visible(struct kobject *kobj, static umode_t fan_dev_is_visible(struct kobject *kobj,
struct attribute *a, int index) 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); struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
if (!priv->fan_tach_present[index]) if (!priv->fan_tach_present[index])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment