* [lm-sensors] [PATCH] hwmon: (max6697) Use of_property_read_bool at appropriate places
@ 2014-07-29 15:06 Axel Lin
2014-07-29 16:47 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-07-29 15:06 UTC (permalink / raw)
To: lm-sensors
This slightly improves readability.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/hwmon/max6697.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c
index 7fd3eaf..f03a717 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]);
--
1.9.1
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (max6697) Use of_property_read_bool at appropriate places
2014-07-29 15:06 [lm-sensors] [PATCH] hwmon: (max6697) Use of_property_read_bool at appropriate places Axel Lin
@ 2014-07-29 16:47 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2014-07-29 16:47 UTC (permalink / raw)
To: lm-sensors
On Tue, Jul 29, 2014 at 11:06:22PM +0800, Axel Lin wrote:
> This slightly improves readability.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Applied to -next.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-29 16:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-29 15:06 [lm-sensors] [PATCH] hwmon: (max6697) Use of_property_read_bool at appropriate places Axel Lin
2014-07-29 16:47 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.