Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755707AbbHFNK2 (ORCPT ); Thu, 6 Aug 2015 09:10:28 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:36061 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbbHFNK0 (ORCPT ); Thu, 6 Aug 2015 09:10:26 -0400 From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Tomeu Vizoso , Peter Chen , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH] usb: chipidea: imx: properly check for usbmisc Date: Thu, 6 Aug 2015 15:09:54 +0200 Message-Id: <1438866594-5875-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1279 Lines: 35 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 --- drivers/usb/chipidea/ci_hdrc_imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 504554e41922..e3c61d5e9270 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; -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/