projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
124b7e3
)
hwmon: Switch to using the new API kobj_to_dev()
author
Yang Li
<yang.lee@linux.alibaba.com>
Tue, 23 Feb 2021 09:14:27 +0000
(17:14 +0800)
committer
Guenter Roeck
<linux@roeck-us.net>
Tue, 20 Apr 2021 13:50:14 +0000
(06:50 -0700)
fixed the following coccicheck:
./drivers/hwmon/hwmon.c:82:60-61: WARNING opportunity for kobj_to_dev()
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link:
https://lore.kernel.org/r/1614071667-5665-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/hwmon.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/hwmon.c
b/drivers/hwmon/hwmon.c
index 6c684058bfdfc0c14f616e839517df95639b8772..fd47ab4e68922ada1fa724d42c672c0848a6427c 100644
(file)
--- a/
drivers/hwmon/hwmon.c
+++ b/
drivers/hwmon/hwmon.c
@@
-79,7
+79,7
@@
static struct attribute *hwmon_dev_attrs[] = {
static umode_t hwmon_dev_name_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
- struct device *dev =
container_of(kobj, struct device,
kobj);
+ struct device *dev =
kobj_to_dev(
kobj);
if (to_hwmon_device(dev)->name == NULL)
return 0;