Commit 2e559638 authored by Fabio Estevam's avatar Fabio Estevam Committed by Greg Kroah-Hartman

usb: phy: phy-mxs-usb: Use of_device_get_match_data()

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.
Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
Acked-by: default avatarFelipe Balbi <balbi@kernel.org>
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118152615.1644861-1-festevam@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c25c210f
...@@ -714,14 +714,9 @@ static int mxs_phy_probe(struct platform_device *pdev) ...@@ -714,14 +714,9 @@ static int mxs_phy_probe(struct platform_device *pdev)
struct clk *clk; struct clk *clk;
struct mxs_phy *mxs_phy; struct mxs_phy *mxs_phy;
int ret; int ret;
const struct of_device_id *of_id;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
u32 val; 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); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
...@@ -797,7 +792,7 @@ static int mxs_phy_probe(struct platform_device *pdev) ...@@ -797,7 +792,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
mxs_phy->phy.charger_detect = mxs_phy_charger_detect; mxs_phy->phy.charger_detect = mxs_phy_charger_detect;
mxs_phy->clk = clk; 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); platform_set_drvdata(pdev, mxs_phy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment