Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef12da91 authored by Tomeu Vizoso's avatar Tomeu Vizoso Committed by Peter Chen
Browse files

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: default avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
parent bc249379
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;