diff options
author | Fabio Estevam <festevam@gmail.com> | 2020-11-24 19:39:12 +0300 |
---|---|---|
committer | Peter Chen <peter.chen@nxp.com> | 2020-12-10 12:35:33 +0300 |
commit | 59b7c6a8fd6c44d2683d02d63e137d0c11855c32 (patch) | |
tree | c957711b610411a21d99670f3d0e23866b85605f /drivers/usb | |
parent | 58bcafec8062f7566b736a019c3506949f9be6d3 (diff) | |
download | linux-59b7c6a8fd6c44d2683d02d63e137d0c11855c32.tar.xz |
usb: chipidea: ci_hdrc_imx: 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.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 25c65accf089..8fa712148e5d 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -319,16 +319,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) .notify_event = ci_hdrc_imx_notify_event, }; int ret; - const struct of_device_id *of_id; const struct ci_hdrc_imx_platform_flag *imx_platform_flag; struct device_node *np = pdev->dev.of_node; struct device *dev = &pdev->dev; - of_id = of_match_device(ci_hdrc_imx_dt_ids, dev); - if (!of_id) - return -ENODEV; - - imx_platform_flag = of_id->data; + imx_platform_flag = of_device_get_match_data(&pdev->dev); data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) |