diff options
| author | Geert Uytterhoeven <geert+renesas@glider.be> | 2026-01-21 15:11:23 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-23 17:16:54 +0100 |
| commit | 1360eb44d2af7baa9357a7c4dd4952c6dd5e9d6f (patch) | |
| tree | 15c7d1a9556375d26bafe2a7ece3690a86abe4cd | |
| parent | c9d032cbcac4ee81602232d25a3da0c8d934e1c2 (diff) | |
usb: phy: generic: Convert to device property API
Convert from OF properties to device properties, to make the driver more
generic and simpler.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/e69adff1d6ca7b26cd2a4117d45392e05470d27c.1769004444.git.geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/usb/phy/phy-generic.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 9f3a38b93f26..de26b302334d 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -20,7 +20,7 @@ #include <linux/slab.h> #include <linux/clk.h> #include <linux/regulator/consumer.h> -#include <linux/of.h> +#include <linux/property.h> #include <linux/gpio/consumer.h> #include <linux/delay.h> @@ -199,12 +199,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop) int err = 0; u32 clk_rate = 0; - if (dev->of_node) { - struct device_node *node = dev->of_node; - - if (of_property_read_u32(node, "clock-frequency", &clk_rate)) - clk_rate = 0; - } + device_property_read_u32(dev, "clock-frequency", &clk_rate); nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS); err = PTR_ERR_OR_ZERO(nop->gpiod_reset); @@ -269,7 +264,6 @@ EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy); static int usb_phy_generic_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *dn = dev->of_node; struct usb_phy_generic *nop; int err; @@ -305,7 +299,7 @@ static int usb_phy_generic_probe(struct platform_device *pdev) platform_set_drvdata(pdev, nop); device_set_wakeup_capable(dev, - of_property_read_bool(dn, "wakeup-source")); + device_property_read_bool(dev, "wakeup-source")); return 0; } |
