summaryrefslogtreecommitdiff
path: root/drivers/phy/ti/phy-omap-usb2.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-09 12:29:10 -0500
committerVinod Koul <vkoul@kernel.org>2023-10-13 15:45:40 +0530
commit21bf6fc47a1e45031ba8a7084343b7cfd09ed1d3 (patch)
treeb8c8a340fccab45cae639701862502e9c3d8a6fd /drivers/phy/ti/phy-omap-usb2.c
parent7e909370a5cd44b4c16df500fb40762f48aae966 (diff)
downloadlwn-21bf6fc47a1e45031ba8a7084343b7cfd09ed1d3.tar.gz
lwn-21bf6fc47a1e45031ba8a7084343b7cfd09ed1d3.zip
phy: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20231009172923.2457844-15-robh@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy/ti/phy-omap-usb2.c')
-rw-r--r--drivers/phy/ti/phy-omap-usb2.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
index 762d3de8b3c5..dd2913ac0fa2 100644
--- a/drivers/phy/ti/phy-omap-usb2.c
+++ b/drivers/phy/ti/phy-omap-usb2.c
@@ -19,6 +19,7 @@
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/sys_soc.h>
@@ -371,16 +372,12 @@ static int omap_usb2_probe(struct platform_device *pdev)
struct device_node *node = pdev->dev.of_node;
struct device_node *control_node;
struct platform_device *control_pdev;
- const struct of_device_id *of_id;
- struct usb_phy_data *phy_data;
+ const struct usb_phy_data *phy_data;
- of_id = of_match_device(omap_usb2_id_table, &pdev->dev);
-
- if (!of_id)
+ phy_data = device_get_match_data(&pdev->dev);
+ if (!phy_data)
return -EINVAL;
- phy_data = (struct usb_phy_data *)of_id->data;
-
phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
if (!phy)
return -ENOMEM;