aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorFabio Estevam2020-11-24 13:39:11 -0300
committerPeter Chen2020-12-10 17:35:33 +0800
commit58bcafec8062f7566b736a019c3506949f9be6d3 (patch)
tree8d0c7d755059772be8f02d788a9f1b4098e0b74e /drivers/usb
parent448373d9db1a7000072f65103af19e20503f0c0c (diff)
usb: chipidea: usbmisc_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/usbmisc_imx.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 6d8331e7da99..4545b23bda3f 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -1134,11 +1134,6 @@ MODULE_DEVICE_TABLE(of, usbmisc_imx_dt_ids);
static int usbmisc_imx_probe(struct platform_device *pdev)
{
struct imx_usbmisc *data;
- const struct of_device_id *of_id;
-
- of_id = of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
- if (!of_id)
- return -ENODEV;
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
@@ -1150,7 +1145,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
if (IS_ERR(data->base))
return PTR_ERR(data->base);
- data->ops = (const struct usbmisc_ops *)of_id->data;
+ data->ops = of_device_get_match_data(&pdev->dev);
platform_set_drvdata(pdev, data);
return 0;