From: Tomeu Vizoso Date: Thu, 6 Aug 2015 13:09:54 +0000 (+0200) Subject: usb: chipidea: imx: properly check for usbmisc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef12da914ed696745b495bea22aea137e88cffb6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: chipidea: imx: properly check for usbmisc If usbmisc hasn't probed yet, defer the probe. It's not enough to check if the platform device for the OF node of the usbmisc has been registered, but it also needs to have been probed already before we can call imx_usbmisc_init(). This can happen if the order in which devices are probed change due to async probing or on-demand probing of dependencies. Signed-off-by: Tomeu Vizoso --- diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 6d2a85a8bdcf..9ccae5a33147 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -104,7 +104,7 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) misc_pdev = of_find_device_by_node(args.np); of_node_put(args.np); - if (!misc_pdev) + if (!misc_pdev || !platform_get_drvdata(misc_pdev)) return ERR_PTR(-EPROBE_DEFER); data->dev = &misc_pdev->dev;