]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: Use (of|device)_property_present() for non-boolean properties
authorRob Herring (Arm) <robh@kernel.org>
Mon, 4 Nov 2024 19:08:18 +0000 (13:08 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Nov 2024 12:29:26 +0000 (13:29 +0100)
The use of (of|device)_property_read_bool() for non-boolean properties
is deprecated in favor of of_property_present() when testing for
property presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Peter Chen <peter.chen@kernel.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20241104190820.277702-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/core.c
drivers/usb/dwc3/core.c
drivers/usb/dwc3/dwc3-omap.c
drivers/usb/dwc3/dwc3-qcom.c
drivers/usb/mtu3/mtu3_plat.c
drivers/usb/phy/phy.c
drivers/usb/renesas_usbhs/common.c

index 2d01af746ff8fe4a0e09aff9718a8f8d9a1d0bdc..694b4a8e4e1d8583dcbf4a42f8c2dfd785d5745c 100644 (file)
@@ -765,7 +765,7 @@ static int ci_get_platdata(struct device *dev,
 
        ext_id = ERR_PTR(-ENODEV);
        ext_vbus = ERR_PTR(-ENODEV);
-       if (of_property_read_bool(dev->of_node, "extcon")) {
+       if (of_property_present(dev->of_node, "extcon")) {
                /* Each one of them is not mandatory */
                ext_vbus = extcon_get_edev_by_phandle(dev, 0);
                if (IS_ERR(ext_vbus) && PTR_ERR(ext_vbus) != -ENODEV)
index de434f78c560fe24d1656a7b66189cae7ad90934..9b888d33e64df2323eb6df74ff62a7ccdcf7c99e 100644 (file)
@@ -1941,7 +1941,7 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
        struct extcon_dev *edev = NULL;
        const char *name;
 
-       if (device_property_read_bool(dev, "extcon"))
+       if (device_property_present(dev, "extcon"))
                return extcon_get_edev_by_phandle(dev, 0);
 
        /*
index 5582d45de110c6b0414e2776caa085389db23517..b261c46124c612a79fa84970dccc321511583370 100644 (file)
@@ -416,7 +416,7 @@ static int dwc3_omap_extcon_register(struct dwc3_omap *omap)
        struct device_node      *node = omap->dev->of_node;
        struct extcon_dev       *edev;
 
-       if (of_property_read_bool(node, "extcon")) {
+       if (of_property_present(node, "extcon")) {
                edev = extcon_get_edev_by_phandle(omap->dev, 0);
                if (IS_ERR(edev)) {
                        dev_vdbg(omap->dev, "couldn't get extcon device\n");
index 48fee453774313a7de49fd5837970720c3c23d45..58683bb672e9522deb321c38daffd856c0d9029c 100644 (file)
@@ -161,7 +161,7 @@ static int dwc3_qcom_register_extcon(struct dwc3_qcom *qcom)
        struct extcon_dev       *host_edev;
        int                     ret;
 
-       if (!of_property_read_bool(dev->of_node, "extcon"))
+       if (!of_property_present(dev->of_node, "extcon"))
                return 0;
 
        qcom->edev = extcon_get_edev_by_phandle(dev, 0);
index 6b6f3f8e89a9d0378d05e05fa5df2ce922124fa4..7b5a431acb56571ec9c376065a16e2f56f3a8a89 100644 (file)
@@ -307,7 +307,7 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
        if (otg_sx->role_sw_used || otg_sx->manual_drd_enabled)
                goto out;
 
-       if (of_property_read_bool(node, "extcon")) {
+       if (of_property_present(node, "extcon")) {
                otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0);
                if (IS_ERR(otg_sx->edev)) {
                        return dev_err_probe(dev, PTR_ERR(otg_sx->edev),
index 06f789097989f19fbdd41bbc035013f9958c3cc9..1ce134505cee86102eb2d93ca1d09a52b684d3bb 100644 (file)
@@ -365,7 +365,7 @@ static int usb_add_extcon(struct usb_phy *x)
 {
        int ret;
 
-       if (of_property_read_bool(x->dev->of_node, "extcon")) {
+       if (of_property_present(x->dev->of_node, "extcon")) {
                x->edev = extcon_get_edev_by_phandle(x->dev, 0);
                if (IS_ERR(x->edev))
                        return PTR_ERR(x->edev);
index 61b440cc3a168c16e91979f2002e411a6afd4a4c..935fc496fe94b6d97b2445c5f43ac33c5fa9911d 100644 (file)
@@ -632,7 +632,7 @@ static int usbhs_probe(struct platform_device *pdev)
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
-       if (of_property_read_bool(dev_of_node(dev), "extcon")) {
+       if (of_property_present(dev_of_node(dev), "extcon")) {
                priv->edev = extcon_get_edev_by_phandle(dev, 0);
                if (IS_ERR(priv->edev))
                        return PTR_ERR(priv->edev);