All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] usb: phy: phy-mxs-usb: Use of_device_get_match_data()
@ 2021-01-18 15:26 Fabio Estevam
  2021-01-18 15:34 ` Felipe Balbi
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2021-01-18 15:26 UTC (permalink / raw)
  To: balbi; +Cc: linux-usb, peter.chen, Fabio Estevam

The retrieval of driver data via of_device_get_match_data() can make
the code simpler.

Use of_device_get_match_data() to simplify the code. 

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/phy/phy-mxs-usb.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 67b39dc62b37..8a262c5a0408 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -714,14 +714,9 @@ static int mxs_phy_probe(struct platform_device *pdev)
 	struct clk *clk;
 	struct mxs_phy *mxs_phy;
 	int ret;
-	const struct of_device_id *of_id;
 	struct device_node *np = pdev->dev.of_node;
 	u32 val;
 
-	of_id = of_match_device(mxs_phy_dt_ids, &pdev->dev);
-	if (!of_id)
-		return -ENODEV;
-
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
@@ -797,7 +792,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
 	mxs_phy->phy.charger_detect	= mxs_phy_charger_detect;
 
 	mxs_phy->clk = clk;
-	mxs_phy->data = of_id->data;
+	mxs_phy->data = of_device_get_match_data(&pdev->dev);
 
 	platform_set_drvdata(pdev, mxs_phy);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] usb: phy: phy-mxs-usb: Use of_device_get_match_data()
  2021-01-18 15:26 [PATCH RESEND] usb: phy: phy-mxs-usb: Use of_device_get_match_data() Fabio Estevam
@ 2021-01-18 15:34 ` Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2021-01-18 15:34 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-usb, peter.chen, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

Hi,

Fabio Estevam <festevam@gmail.com> writes:

> The retrieval of driver data via of_device_get_match_data() can make
> the code simpler.
>
> Use of_device_get_match_data() to simplify the code. 
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> Acked-by: Peter Chen <peter.chen@nxp.com>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-18 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 15:26 [PATCH RESEND] usb: phy: phy-mxs-usb: Use of_device_get_match_data() Fabio Estevam
2021-01-18 15:34 ` Felipe Balbi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.