1
0
Fork 0

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>
wifi-calibration
Axel Lin 2014-07-29 23:06:22 +08:00 committed by Guenter Roeck
parent dbd1db7d42
commit 8de2dcc9a1
1 changed files with 7 additions and 9 deletions

View File

@ -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]);