Commit 334007d5 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Greg Kroah-Hartman

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: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b64d47ae
...@@ -190,10 +190,7 @@ EXPORT_SYMBOL_GPL(of_usb_get_dr_mode_by_phy); ...@@ -190,10 +190,7 @@ EXPORT_SYMBOL_GPL(of_usb_get_dr_mode_by_phy);
*/ */
bool of_usb_host_tpl_support(struct device_node *np) bool of_usb_host_tpl_support(struct device_node *np)
{ {
if (of_find_property(np, "tpl-support", NULL)) return of_property_read_bool(np, "tpl-support");
return true;
return false;
} }
EXPORT_SYMBOL_GPL(of_usb_host_tpl_support); EXPORT_SYMBOL_GPL(of_usb_host_tpl_support);
...@@ -240,11 +237,11 @@ int of_usb_update_otg_caps(struct device_node *np, ...@@ -240,11 +237,11 @@ int of_usb_update_otg_caps(struct device_node *np,
otg_caps->otg_rev = 0; otg_caps->otg_rev = 0;
} }
if (of_find_property(np, "hnp-disable", NULL)) if (of_property_read_bool(np, "hnp-disable"))
otg_caps->hnp_support = false; otg_caps->hnp_support = false;
if (of_find_property(np, "srp-disable", NULL)) if (of_property_read_bool(np, "srp-disable"))
otg_caps->srp_support = false; otg_caps->srp_support = false;
if (of_find_property(np, "adp-disable", NULL) || if (of_property_read_bool(np, "adp-disable") ||
(otg_caps->otg_rev < 0x0200)) (otg_caps->otg_rev < 0x0200))
otg_caps->adp_support = false; otg_caps->adp_support = false;
......
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