diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 08:47:20 -0600 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-03-20 18:14:58 +0530 |
commit | 8e9930e14d040bde33a11a62eee8c3c6981c7126 (patch) | |
tree | d75bd46d91afef5d81894c6629191e2835a89535 /drivers/phy/allwinner | |
parent | a01c9d19422e486578d7cfdf799e464025417eab (diff) | |
download | linux-8e9930e14d040bde33a11a62eee8c3c6981c7126.tar.gz linux-8e9930e14d040bde33a11a62eee8c3c6981c7126.tar.bz2 linux-8e9930e14d040bde33a11a62eee8c3c6981c7126.zip |
phy: 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>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20230310144720.1544600-1-robh@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy/allwinner')
-rw-r--r-- | drivers/phy/allwinner/phy-sun4i-usb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 6a74e5ce180a..56d53f78d002 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -756,7 +756,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) return PTR_ERR(data->vbus_det_gpio); } - if (of_find_property(np, "usb0_vbus_power-supply", NULL)) { + if (of_property_present(np, "usb0_vbus_power-supply")) { data->vbus_power_supply = devm_power_supply_get_by_phandle(dev, "usb0_vbus_power-supply"); if (IS_ERR(data->vbus_power_supply)) { |