aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMinghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>2022-02-14 02:06:26 +0000
committerVinod Koul <vkoul@kernel.org>2022-02-25 13:58:12 +0530
commit10c573c61338d80c271f3579da22772c483d8a7a (patch)
tree61bbf981d98f5e480d7114c0f9482cd7e648d147 /drivers
parentphy: sun4i-usb: Add D1 variant (diff)
downloadlinux-dev-10c573c61338d80c271f3579da22772c483d8a7a.tar.xz
linux-dev-10c573c61338d80c271f3579da22772c483d8a7a.zip
phy/cadence: Use of_device_get_match_data()
Use of_device_get_match_data() instead of open-coding it. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220214020626.1714696-1-chi.minghao@zte.com.cn Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/phy/cadence/phy-cadence-salvo.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c
index 51c0b98f5fd7..e569f5f67578 100644
--- a/drivers/phy/cadence/phy-cadence-salvo.c
+++ b/drivers/phy/cadence/phy-cadence-salvo.c
@@ -263,14 +263,9 @@ static int cdns_salvo_phy_probe(struct platform_device *pdev)
struct phy_provider *phy_provider;
struct device *dev = &pdev->dev;
struct cdns_salvo_phy *salvo_phy;
- const struct of_device_id *match;
struct cdns_salvo_data *data;
- match = of_match_device(cdns_salvo_phy_of_match, dev);
- if (!match)
- return -EINVAL;
-
- data = (struct cdns_salvo_data *)match->data;
+ data = (struct cdns_salvo_data *)of_device_get_match_data(dev);
salvo_phy = devm_kzalloc(dev, sizeof(*salvo_phy), GFP_KERNEL);
if (!salvo_phy)
return -ENOMEM;