regulator: proxy-consumer: fix of_property_read_bool() usage

The function of_property_read_bool() is used in the
proxy-consumer driver to test for the existence of non-boolean
device tree properties qcom,proxy-consumer-voltage and
qcom,proxy-consumer-current.  These calls will work as expected;
however, of_property_read_bool() is only meant to be used for
reading boolean device tree properties.

Replace all usages of of_property_read_bool() which test for
non-boolean property existence with of_find_property().

Change-Id: I83a718d05f5495f514d6a70004fcb5a2780d45c0
Signed-off-by: David Collins <collinsd@codeaurora.org>
This commit is contained in:
David Collins 2014-08-04 17:22:36 -07:00
parent ed37f85190
commit 589cf93950
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -60,9 +60,9 @@ struct proxy_consumer *regulator_proxy_consumer_register(struct device *reg_dev,
int rc;
/* Return immediately if no proxy consumer properties are specified. */
if (!of_property_read_bool(reg_node, "qcom,proxy-consumer-enable")
&& !of_property_read_bool(reg_node, "qcom,proxy-consumer-voltage")
&& !of_property_read_bool(reg_node, "qcom,proxy-consumer-current"))
if (!of_find_property(reg_node, "qcom,proxy-consumer-enable", NULL)
&& !of_find_property(reg_node, "qcom,proxy-consumer-voltage", NULL)
&& !of_find_property(reg_node, "qcom,proxy-consumer-current", NULL))
return NULL;
mutex_lock(&proxy_consumer_list_mutex);