hwmon: (max6697) Use of_property_read_bool at appropriate places
authorAxel Lin <axel.lin@ingics.com>
Tue, 29 Jul 2014 15:06:22 +0000 (23:06 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 4 Aug 2014 14:01:40 +0000 (07:01 -0700)
This slightly improves readability.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/max6697.c

index 7fd3eaf817f4bffe48267887032b1fa15c81847c..f03a71722849acc85f76af700d44f6cc532dc11c 100644 (file)
@@ -495,15 +495,13 @@ static void max6697_get_config_of(struct device_node *node,
        int len;
        const __be32 *prop;
 
-       prop = of_get_property(node, "smbus-timeout-disable", &len);
-       if (prop)
-               pdata->smbus_timeout_disable = true;
-       prop = of_get_property(node, "extended-range-enable", &len);
-       if (prop)
-               pdata->extended_range_enable = true;
-       prop = of_get_property(node, "beta-compensation-enable", &len);
-       if (prop)
-               pdata->beta_compensation = true;
+       pdata->smbus_timeout_disable =
+               of_property_read_bool(node, "smbus-timeout-disable");
+       pdata->extended_range_enable =
+               of_property_read_bool(node, "extended-range-enable");
+       pdata->beta_compensation =
+               of_property_read_bool(node, "beta-compensation-enable");
+
        prop = of_get_property(node, "alert-mask", &len);
        if (prop && len == sizeof(u32))
                pdata->alert_mask = be32_to_cpu(prop[0]);