summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-05-29 07:28:33 +0300
committerJoel Stanley <joel@jms.id.au>2018-05-30 06:05:22 +0300
commitc8a956faa9ce098eebd7d15cac12bb32a60628a7 (patch)
tree64d47cc6f848ab24dc163fc58f2fd8255ad3ef29
parent1305f7cf04b913b789796bb6938f86bed9c7181a (diff)
downloadlinux-c8a956faa9ce098eebd7d15cac12bb32a60628a7.tar.xz
hwmon: occ: Properly initialize sysfs attributes
Otherwise, lockdep will complain OpenBMC-Staging-Count: 1 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Joel Stanley <joel@jms.id.au>
-rw-r--r--drivers/hwmon/occ/common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c
index 16fcae4b45bc..c1bccf53b425 100644
--- a/drivers/hwmon/occ/common.c
+++ b/drivers/hwmon/occ/common.c
@@ -1166,8 +1166,10 @@ static int occ_setup_sensor_attrs(struct occ *occ)
}
/* put the sensors in the group */
- for (i = 0; i < num_attrs; ++i)
+ for (i = 0; i < num_attrs; ++i) {
+ sysfs_attr_init(&occ->attrs[i].sensor.dev_attr.attr);
occ->group.attrs[i] = &occ->attrs[i].sensor.dev_attr.attr;
+ }
return 0;
}