Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Peter Chen <peter.chen@nxp.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118152615.1644861-1-festevam@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Fabio Estevam and committed by
Greg Kroah-Hartman
2e559638 c25c210f

+1 -6
+1 -6
drivers/usb/phy/phy-mxs-usb.c
··· 714 714 struct clk *clk; 715 715 struct mxs_phy *mxs_phy; 716 716 int ret; 717 - const struct of_device_id *of_id; 718 717 struct device_node *np = pdev->dev.of_node; 719 718 u32 val; 720 - 721 - of_id = of_match_device(mxs_phy_dt_ids, &pdev->dev); 722 - if (!of_id) 723 - return -ENODEV; 724 719 725 720 base = devm_platform_ioremap_resource(pdev, 0); 726 721 if (IS_ERR(base)) ··· 792 797 mxs_phy->phy.charger_detect = mxs_phy_charger_detect; 793 798 794 799 mxs_phy->clk = clk; 795 - mxs_phy->data = of_id->data; 800 + mxs_phy->data = of_device_get_match_data(&pdev->dev); 796 801 797 802 platform_set_drvdata(pdev, mxs_phy); 798 803