aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-07-29 11:06:22 -0400
committerGuenter Roeck <linux@roeck-us.net>2014-08-04 10:01:40 -0400
commit8de2dcc9a1355f83885d34888b7e6549d9ea6d92 (patch)
tree264ac6938894641970b7b7cc13bec05be9201548
parentdbd1db7d42c053f2f937dc52c5644e105043b082 (diff)
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>
-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,
495 int len; 495 int len;
496 const __be32 *prop; 496 const __be32 *prop;
497 497
498 prop = of_get_property(node, "smbus-timeout-disable", &len); 498 pdata->smbus_timeout_disable =
499 if (prop) 499 of_property_read_bool(node, "smbus-timeout-disable");
500 pdata->smbus_timeout_disable = true; 500 pdata->extended_range_enable =
501 prop = of_get_property(node, "extended-range-enable", &len); 501 of_property_read_bool(node, "extended-range-enable");
502 if (prop) 502 pdata->beta_compensation =
503 pdata->extended_range_enable = true; 503 of_property_read_bool(node, "beta-compensation-enable");
504 prop = of_get_property(node, "beta-compensation-enable", &len); 504
505 if (prop)
506 pdata->beta_compensation = true;
507 prop = of_get_property(node, "alert-mask", &len); 505 prop = of_get_property(node, "alert-mask", &len);
508 if (prop && len == sizeof(u32)) 506 if (prop && len == sizeof(u32))
509 pdata->alert_mask = be32_to_cpu(prop[0]); 507 pdata->alert_mask = be32_to_cpu(prop[0]);