Skip to content

Commit 1360eb4

Browse files
geertugregkh
authored andcommitted
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>
1 parent c9d032c commit 1360eb4

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

drivers/usb/phy/phy-generic.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <linux/slab.h>
2121
#include <linux/clk.h>
2222
#include <linux/regulator/consumer.h>
23-
#include <linux/of.h>
23+
#include <linux/property.h>
2424
#include <linux/gpio/consumer.h>
2525
#include <linux/delay.h>
2626

@@ -199,12 +199,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)
199199
int err = 0;
200200
u32 clk_rate = 0;
201201

202-
if (dev->of_node) {
203-
struct device_node *node = dev->of_node;
204-
205-
if (of_property_read_u32(node, "clock-frequency", &clk_rate))
206-
clk_rate = 0;
207-
}
202+
device_property_read_u32(dev, "clock-frequency", &clk_rate);
208203
nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset",
209204
GPIOD_ASIS);
210205
err = PTR_ERR_OR_ZERO(nop->gpiod_reset);
@@ -269,7 +264,6 @@ EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy);
269264
static int usb_phy_generic_probe(struct platform_device *pdev)
270265
{
271266
struct device *dev = &pdev->dev;
272-
struct device_node *dn = dev->of_node;
273267
struct usb_phy_generic *nop;
274268
int err;
275269

@@ -305,7 +299,7 @@ static int usb_phy_generic_probe(struct platform_device *pdev)
305299
platform_set_drvdata(pdev, nop);
306300

307301
device_set_wakeup_capable(dev,
308-
of_property_read_bool(dn, "wakeup-source"));
302+
device_property_read_bool(dev, "wakeup-source"));
309303

310304
return 0;
311305
}

0 commit comments

Comments
 (0)