diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 08:47:28 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-16 12:14:56 +0100 |
commit | f977caea50381e9ca38319037a2b23fe3209d647 (patch) | |
tree | dfb9ad4e6e2d64b6cb352360dd2797e3033178e0 /drivers/usb/chipidea | |
parent | a3927e1a9f1c3b7d71d9c8215905397e55da4da3 (diff) |
usb: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Richard Leitner <richard.leitner@skidata.com>
Link: https://lore.kernel.org/r/20230310144729.1545857-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 6 | ||||
-rw-r--r-- | drivers/usb/chipidea/core.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 2eeccf4ec9d6..2855ac303001 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -152,12 +152,12 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) * Check the various over current related properties. If over current * detection is disabled we're not interested in the polarity. */ - if (of_find_property(np, "disable-over-current", NULL)) { + if (of_property_read_bool(np, "disable-over-current")) { data->disable_oc = 1; - } else if (of_find_property(np, "over-current-active-high", NULL)) { + } else if (of_property_read_bool(np, "over-current-active-high")) { data->oc_pol_active_low = 0; data->oc_pol_configured = 1; - } else if (of_find_property(np, "over-current-active-low", NULL)) { + } else if (of_property_read_bool(np, "over-current-active-low")) { data->oc_pol_active_low = 1; data->oc_pol_configured = 1; } else { diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 27c601296130..7ccb223ed53c 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -753,7 +753,7 @@ static int ci_get_platdata(struct device *dev, return ret; } - if (of_find_property(dev->of_node, "non-zero-ttctrl-ttha", NULL)) + if (of_property_read_bool(dev->of_node, "non-zero-ttctrl-ttha")) platdata->flags |= CI_HDRC_SET_NON_ZERO_TTHA; ext_id = ERR_PTR(-ENODEV); |