Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Geert Uytterhoeven and committed by
Greg Kroah-Hartman
1360eb44 c9d032cb

+3 -9
+3 -9
drivers/usb/phy/phy-generic.c
··· 20 20 #include <linux/slab.h> 21 21 #include <linux/clk.h> 22 22 #include <linux/regulator/consumer.h> 23 - #include <linux/of.h> 23 + #include <linux/property.h> 24 24 #include <linux/gpio/consumer.h> 25 25 #include <linux/delay.h> 26 26 ··· 199 199 int err = 0; 200 200 u32 clk_rate = 0; 201 201 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); 208 203 nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset", 209 204 GPIOD_ASIS); 210 205 err = PTR_ERR_OR_ZERO(nop->gpiod_reset); ··· 264 269 static int usb_phy_generic_probe(struct platform_device *pdev) 265 270 { 266 271 struct device *dev = &pdev->dev; 267 - struct device_node *dn = dev->of_node; 268 272 struct usb_phy_generic *nop; 269 273 int err; 270 274 ··· 299 305 platform_set_drvdata(pdev, nop); 300 306 301 307 device_set_wakeup_capable(dev, 302 - of_property_read_bool(dn, "wakeup-source")); 308 + device_property_read_bool(dev, "wakeup-source")); 303 309 304 310 return 0; 305 311 }