]> git.karo-electronics.de Git - karo-tx-linux.git/commit
usb: chipidea: prevent endless loop registering platform_devices when probe fails
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 31 Jul 2013 14:21:16 +0000 (16:21 +0200)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:48 +0000 (09:54 +0800)
commit67784cafd89f7640c85b0ad14d16a0320d54c094
tree2736ffb53015f802cadb6d6bd9891876ac9bdfd8
parent2fa79b80f2c12abdd91388931adcdcc14bd6a692
usb: chipidea: prevent endless loop registering platform_devices when probe fails

Commit 40dcd0e ("usb: chipidea: add PTW, PTS and STS handling") introduced
the following code to the ci_hdrc_probe() function:

+       if (!dev->of_node && dev->parent)
+               dev->of_node = dev->parent->of_node;

This inadvertently associates the ci_hdrc device with the ci_hdrc_imx
driver (which created the ci_hdrc device in the first place).

This results in ci_hdrc_imx_probe() being run for the ci_hdrc device
if ci_hdrc_probe() fails for some reason.
ci_hdrc_imx_probe() will happily create a new ci_hdrc platform_device
whose probing will likewise fail and trigger a new invocation of
ci_hdrc_imx_probe() ... ad nauseam.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-and-tested-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
drivers/usb/chipidea/core.c