Commit 8de2dcc9 authored by Axel Lin's avatar Axel Lin Committed by Guenter Roeck

hwmon: (max6697) Use of_property_read_bool at appropriate places

This slightly improves readability.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent dbd1db7d
...@@ -495,15 +495,13 @@ static void max6697_get_config_of(struct device_node *node, ...@@ -495,15 +495,13 @@ static void max6697_get_config_of(struct device_node *node,
int len; int len;
const __be32 *prop; const __be32 *prop;
prop = of_get_property(node, "smbus-timeout-disable", &len); pdata->smbus_timeout_disable =
if (prop) of_property_read_bool(node, "smbus-timeout-disable");
pdata->smbus_timeout_disable = true; pdata->extended_range_enable =
prop = of_get_property(node, "extended-range-enable", &len); of_property_read_bool(node, "extended-range-enable");
if (prop) pdata->beta_compensation =
pdata->extended_range_enable = true; of_property_read_bool(node, "beta-compensation-enable");
prop = of_get_property(node, "beta-compensation-enable", &len);
if (prop)
pdata->beta_compensation = true;
prop = of_get_property(node, "alert-mask", &len); prop = of_get_property(node, "alert-mask", &len);
if (prop && len == sizeof(u32)) if (prop && len == sizeof(u32))
pdata->alert_mask = be32_to_cpu(prop[0]); pdata->alert_mask = be32_to_cpu(prop[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment