projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7a6521
)
hwmon: (gpio-fan) Switch to using the new API kobj_to_dev()
author
Tian Tao
<tiantao6@hisilicon.com>
Tue, 29 Dec 2020 03:17:17 +0000
(11:17 +0800)
committer
Guenter Roeck
<linux@roeck-us.net>
Thu, 28 Jan 2021 01:44:18 +0000
(17:44 -0800)
fixed the following coccicheck:
drivers/hwmon/gpio-fan.c:302:60-61: WARNING opportunity for
kobj_to_dev()
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link:
https://lore.kernel.org/r/1609211837-54930-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/gpio-fan.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/gpio-fan.c
b/drivers/hwmon/gpio-fan.c
index 3ea4021f267cf6bc1b6ce96e436305cd834401ee..befe989ca7b946f27bb1f773b316f97dbf76836a 100644
(file)
--- a/
drivers/hwmon/gpio-fan.c
+++ b/
drivers/hwmon/gpio-fan.c
@@
-299,7
+299,7
@@
static DEVICE_ATTR(fan1_target, 0644, fan1_input_show, set_rpm);
static umode_t gpio_fan_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 gpio_fan_data *data = dev_get_drvdata(dev);
if (index == 0 && !data->alarm_gpio)