summaryrefslogtreecommitdiff
path: root/drivers/usb/host/fsl-mph-dr-of.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 17:47:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-16 14:14:56 +0300
commitf977caea50381e9ca38319037a2b23fe3209d647 (patch)
treedfb9ad4e6e2d64b6cb352360dd2797e3033178e0 /drivers/usb/host/fsl-mph-dr-of.c
parenta3927e1a9f1c3b7d71d9c8215905397e55da4da3 (diff)
downloadlinux-f977caea50381e9ca38319037a2b23fe3209d647.tar.xz
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/host/fsl-mph-dr-of.c')
-rw-r--r--drivers/usb/host/fsl-mph-dr-of.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index cdf71b716c2b..9db909d12354 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -208,11 +208,8 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
pdata->operating_mode = FSL_USB2_MPH_HOST;
} else {
- if (of_get_property(np, "fsl,invert-drvvbus", NULL))
- pdata->invert_drvvbus = 1;
-
- if (of_get_property(np, "fsl,invert-pwr-fault", NULL))
- pdata->invert_pwr_fault = 1;
+ pdata->invert_drvvbus = of_property_read_bool(np, "fsl,invert-drvvbus");
+ pdata->invert_pwr_fault = of_property_read_bool(np, "fsl,invert-pwr-fault");
/* setup mode selected in the device tree */
pdata->operating_mode = dev_data->op_mode;