aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/ibmpowernv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
index e6b652a35815..d2bf2c97ae70 100644
--- a/drivers/hwmon/ibmpowernv.c
+++ b/drivers/hwmon/ibmpowernv.c
@@ -227,7 +227,7 @@ static int __init create_device_attrs(struct platform_device *pdev)
227 const struct attribute_group **pgroups = pdata->attr_groups; 227 const struct attribute_group **pgroups = pdata->attr_groups;
228 struct device_node *opal, *np; 228 struct device_node *opal, *np;
229 struct sensor_data *sdata; 229 struct sensor_data *sdata;
230 const __be32 *sensor_id; 230 u32 sensor_id;
231 enum sensors type; 231 enum sensors type;
232 u32 count = 0; 232 u32 count = 0;
233 int err = 0; 233 int err = 0;
@@ -252,15 +252,14 @@ static int __init create_device_attrs(struct platform_device *pdev)
252 if (type == MAX_SENSOR_TYPE) 252 if (type == MAX_SENSOR_TYPE)
253 continue; 253 continue;
254 254
255 sensor_id = of_get_property(np, "sensor-id", NULL); 255 if (of_property_read_u32(np, "sensor-id", &sensor_id)) {
256 if (!sensor_id) {
257 dev_info(&pdev->dev, 256 dev_info(&pdev->dev,
258 "'sensor-id' missing in the node '%s'\n", 257 "'sensor-id' missing in the node '%s'\n",
259 np->name); 258 np->name);
260 continue; 259 continue;
261 } 260 }
262 261
263 sdata[count].id = be32_to_cpup(sensor_id); 262 sdata[count].id = sensor_id;
264 sdata[count].type = type; 263 sdata[count].type = type;
265 err = create_hwmon_attr_name(&pdev->dev, type, np->name, 264 err = create_hwmon_attr_name(&pdev->dev, type, np->name,
266 sdata[count].name); 265 sdata[count].name);