]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
phy: Use (of|device)_property_present() for non-boolean properties
authorRob Herring (Arm) <robh@kernel.org>
Tue, 31 Dec 2024 16:31:20 +0000 (10:31 -0600)
committerVinod Koul <vkoul@kernel.org>
Mon, 10 Feb 2025 17:10:56 +0000 (22:40 +0530)
The use of (of|device)_property_read_bool() for non-boolean properties
is deprecated in favor of (of|device)_property_present() when testing
for property presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20241231163121.241543-1-robh@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/mediatek/phy-mtk-tphy.c
drivers/phy/rockchip/phy-rockchip-inno-usb2.c

index a496fbe3352b84c39f30dd5c5a83243ab5cfc112..644a34bd2b0be7310b3aac3cc0fcf92a882067fc 100644 (file)
@@ -1195,7 +1195,7 @@ static int phy_type_syscon_get(struct mtk_phy_instance *instance,
        int ret;
 
        /* type switch function is optional */
-       if (!of_property_read_bool(dn, "mediatek,syscon-type"))
+       if (!of_property_present(dn, "mediatek,syscon-type"))
                return 0;
 
        ret = of_parse_phandle_with_fixed_args(dn, "mediatek,syscon-type",
@@ -1258,7 +1258,7 @@ static int phy_efuse_get(struct mtk_tphy *tphy, struct mtk_phy_instance *instanc
        }
 
        /* software efuse is optional */
-       instance->efuse_sw_en = device_property_read_bool(dev, "nvmem-cells");
+       instance->efuse_sw_en = device_property_present(dev, "nvmem-cells");
        if (!instance->efuse_sw_en)
                return 0;
 
index 96f3d868a526fc43855c727f85effb5110205200..b5e6a864deebbcb33375001fc6ed67b2dfee6954 100644 (file)
@@ -440,7 +440,7 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy)
        struct extcon_dev *edev;
        int ret;
 
-       if (of_property_read_bool(node, "extcon")) {
+       if (of_property_present(node, "extcon")) {
                edev = extcon_get_edev_by_phandle(rphy->dev, 0);
                if (IS_ERR(edev))
                        return dev_err_probe(rphy->dev, PTR_ERR(edev),
@@ -1323,7 +1323,7 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
                        goto out;
                }
 
-               if (!of_property_read_bool(rphy->dev->of_node, "extcon")) {
+               if (!of_property_present(rphy->dev->of_node, "extcon")) {
                        /* do initial sync of usb state */
                        id = property_enabled(rphy->grf, &rport->port_cfg->utmi_id);
                        extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !id);