Skip to content

Commit

Permalink
usb: phy: phy-mxs-usb: Use of_device_get_match_data()
Browse files Browse the repository at this point in the history
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: Peter Chen <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Fabio Estevam <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
fabioestevam authored and gregkh committed Jan 18, 2021
1 parent c25c210 commit 2e55963
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/usb/phy/phy-mxs-usb.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 2e55963

Please sign in to comment.