Skip to content

Commit da75b22

Browse files
Tian Taogroeck
Tian Tao
authored andcommitted
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>
1 parent f1fc688 commit da75b22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hwmon/aspeed-pwm-tacho.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static ssize_t rpm_show(struct device *dev, struct device_attribute *attr,
620620
static umode_t pwm_is_visible(struct kobject *kobj,
621621
struct attribute *a, int index)
622622
{
623-
struct device *dev = container_of(kobj, struct device, kobj);
623+
struct device *dev = kobj_to_dev(kobj);
624624
struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
625625

626626
if (!priv->pwm_present[index])
@@ -631,7 +631,7 @@ static umode_t pwm_is_visible(struct kobject *kobj,
631631
static umode_t fan_dev_is_visible(struct kobject *kobj,
632632
struct attribute *a, int index)
633633
{
634-
struct device *dev = container_of(kobj, struct device, kobj);
634+
struct device *dev = kobj_to_dev(kobj);
635635
struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
636636

637637
if (!priv->fan_tach_present[index])

0 commit comments

Comments
 (0)