* [PATCH] phy/cadence: Use of_device_get_match_data()
@ 2022-02-14 2:06 cgel.zte
2022-02-25 8:28 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-02-14 2:06 UTC (permalink / raw)
To: kishon; +Cc: vkoul, linux-phy, linux-kernel, Minghao Chi (CGEL ZTE),
Zeal Robot
From: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>
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>
---
drivers/phy/cadence/phy-cadence-salvo.c | 7 +------
1 file changed, 1 insertion(+), 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;
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] phy/cadence: Use of_device_get_match_data()
2022-02-14 2:06 [PATCH] phy/cadence: Use of_device_get_match_data() cgel.zte
@ 2022-02-25 8:28 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-02-25 8:28 UTC (permalink / raw)
To: cgel.zte
Cc: kishon, linux-phy, linux-kernel, Minghao Chi (CGEL ZTE),
Zeal Robot
On 14-02-22, 02:06, cgel.zte@gmail.com wrote:
> From: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>
>
> Use of_device_get_match_data() instead of open-coding it.
Applied, thanks
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-25 8:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-14 2:06 [PATCH] phy/cadence: Use of_device_get_match_data() cgel.zte
2022-02-25 8:28 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).