diff options
Diffstat (limited to 'drivers/usb/chipidea/usbmisc_imx.c')
-rw-r--r-- | drivers/usb/chipidea/usbmisc_imx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index fcea4eb36eee..ab8b027e8cc8 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c | |||
@@ -500,7 +500,11 @@ static int usbmisc_imx_probe(struct platform_device *pdev) | |||
500 | { | 500 | { |
501 | struct resource *res; | 501 | struct resource *res; |
502 | struct imx_usbmisc *data; | 502 | struct imx_usbmisc *data; |
503 | struct of_device_id *tmp_dev; | 503 | const struct of_device_id *of_id; |
504 | |||
505 | of_id = of_match_device(usbmisc_imx_dt_ids, &pdev->dev); | ||
506 | if (!of_id) | ||
507 | return -ENODEV; | ||
504 | 508 | ||
505 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); | 509 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |
506 | if (!data) | 510 | if (!data) |
@@ -513,9 +517,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev) | |||
513 | if (IS_ERR(data->base)) | 517 | if (IS_ERR(data->base)) |
514 | return PTR_ERR(data->base); | 518 | return PTR_ERR(data->base); |
515 | 519 | ||
516 | tmp_dev = (struct of_device_id *) | 520 | data->ops = (const struct usbmisc_ops *)of_id->data; |
517 | of_match_device(usbmisc_imx_dt_ids, &pdev->dev); | ||
518 | data->ops = (const struct usbmisc_ops *)tmp_dev->data; | ||
519 | platform_set_drvdata(pdev, data); | 521 | platform_set_drvdata(pdev, data); |
520 | 522 | ||
521 | return 0; | 523 | return 0; |