aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2017-08-20 14:06:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-28 05:39:31 -0400
commit334007d52597ebb079766ab34711728677130068 (patch)
treeafb2d77419e49d99d14e939b1a33e0a2f6be943d
parentb64d47ae62e5f56727ad6dc2088e13dfab524a83 (diff)
usb: common: use of_property_read_bool()
Use more compact of_property_read_bool() calls for the boolean properties instead of of_find_property() calls in of_usb_host_tpl_support() and of_usb_update_otg_caps(). Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/common/common.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index b91ba3332d8f..552ff7ac5a6b 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -190,10 +190,7 @@ EXPORT_SYMBOL_GPL(of_usb_get_dr_mode_by_phy);
190 */ 190 */
191bool of_usb_host_tpl_support(struct device_node *np) 191bool of_usb_host_tpl_support(struct device_node *np)
192{ 192{
193 if (of_find_property(np, "tpl-support", NULL)) 193 return of_property_read_bool(np, "tpl-support");
194 return true;
195
196 return false;
197} 194}
198EXPORT_SYMBOL_GPL(of_usb_host_tpl_support); 195EXPORT_SYMBOL_GPL(of_usb_host_tpl_support);
199 196
@@ -240,11 +237,11 @@ int of_usb_update_otg_caps(struct device_node *np,
240 otg_caps->otg_rev = 0; 237 otg_caps->otg_rev = 0;
241 } 238 }
242 239
243 if (of_find_property(np, "hnp-disable", NULL)) 240 if (of_property_read_bool(np, "hnp-disable"))
244 otg_caps->hnp_support = false; 241 otg_caps->hnp_support = false;
245 if (of_find_property(np, "srp-disable", NULL)) 242 if (of_property_read_bool(np, "srp-disable"))
246 otg_caps->srp_support = false; 243 otg_caps->srp_support = false;
247 if (of_find_property(np, "adp-disable", NULL) || 244 if (of_property_read_bool(np, "adp-disable") ||
248 (otg_caps->otg_rev < 0x0200)) 245 (otg_caps->otg_rev < 0x0200))
249 otg_caps->adp_support = false; 246 otg_caps->adp_support = false;
250 247