summaryrefslogtreecommitdiff
path: root/drivers/usb/host/fsl-mph-dr-of.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 08:47:27 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-16 12:14:50 +0100
commita3927e1a9f1c3b7d71d9c8215905397e55da4da3 (patch)
tree4b0a77e12d0b38840955570c5d6cb6faca44a840 /drivers/usb/host/fsl-mph-dr-of.c
parenta20bf02aaa6c026e81b2b15d5878c08f683517bb (diff)
downloadlinux-next-a3927e1a9f1c3b7d71d9c8215905397e55da4da3.tar.gz
usb: Use of_property_present() for testing DT property presence
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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230310144728.1545786-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/fsl-mph-dr-of.c')
-rw-r--r--drivers/usb/host/fsl-mph-dr-of.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 46c6a152b865..cdf71b716c2b 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -200,10 +200,10 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
dev_data = get_dr_mode_data(np);
if (of_device_is_compatible(np, "fsl-usb2-mph")) {
- if (of_get_property(np, "port0", NULL))
+ if (of_property_present(np, "port0"))
pdata->port_enables |= FSL_USB2_PORT0_ENABLED;
- if (of_get_property(np, "port1", NULL))
+ if (of_property_present(np, "port1"))
pdata->port_enables |= FSL_USB2_PORT1_ENABLED;
pdata->operating_mode = FSL_USB2_MPH_HOST;