summaryrefslogtreecommitdiff
path: root/drivers/phy/ti/phy-omap-control.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-09 20:29:10 +0300
committerVinod Koul <vkoul@kernel.org>2023-10-13 13:15:40 +0300
commit21bf6fc47a1e45031ba8a7084343b7cfd09ed1d3 (patch)
treeb8c8a340fccab45cae639701862502e9c3d8a6fd /drivers/phy/ti/phy-omap-control.c
parent7e909370a5cd44b4c16df500fb40762f48aae966 (diff)
downloadlinux-21bf6fc47a1e45031ba8a7084343b7cfd09ed1d3.tar.xz
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-control.c')
-rw-r--r--drivers/phy/ti/phy-omap-control.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/phy/ti/phy-omap-control.c b/drivers/phy/ti/phy-omap-control.c
index 76c5595f0859..2fdb8f4241c7 100644
--- a/drivers/phy/ti/phy-omap-control.c
+++ b/drivers/phy/ti/phy-omap-control.c
@@ -8,9 +8,9 @@
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/slab.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/clk.h>
@@ -268,20 +268,15 @@ MODULE_DEVICE_TABLE(of, omap_control_phy_id_table);
static int omap_control_phy_probe(struct platform_device *pdev)
{
- const struct of_device_id *of_id;
struct omap_control_phy *control_phy;
- of_id = of_match_device(omap_control_phy_id_table, &pdev->dev);
- if (!of_id)
- return -EINVAL;
-
control_phy = devm_kzalloc(&pdev->dev, sizeof(*control_phy),
GFP_KERNEL);
if (!control_phy)
return -ENOMEM;
control_phy->dev = &pdev->dev;
- control_phy->type = *(enum omap_control_phy_type *)of_id->data;
+ control_phy->type = *(enum omap_control_phy_type *)device_get_match_data(&pdev->dev);
if (control_phy->type == OMAP_CTRL_TYPE_OTGHS) {
control_phy->otghs_control =