summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-07-29 19:06:22 +0400
committerGuenter Roeck <linux@roeck-us.net>2014-08-04 18:01:40 +0400
commit8de2dcc9a1355f83885d34888b7e6549d9ea6d92 (patch)
tree264ac6938894641970b7b7cc13bec05be9201548 /drivers
parentdbd1db7d42c053f2f937dc52c5644e105043b082 (diff)
downloadlinux-8de2dcc9a1355f83885d34888b7e6549d9ea6d92.tar.xz
hwmon: (max6697) Use of_property_read_bool at appropriate places
This slightly improves readability. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/max6697.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c
index 7fd3eaf817f4..f03a71722849 100644
--- a/drivers/hwmon/max6697.c
+++ b/drivers/hwmon/max6697.c
@@ -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]);