usb: chipidea: Refactor USB PHY selection and keep a single PHY
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Wed, 27 Feb 2019 06:51:38 +0000 (06:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 14:51:02 +0000 (15:51 +0100)
commita3a47548332864887c212bff14dd1d0013ca4547
treebba07408f8eb75f07bfbb67fad334842ad869523
parent68ef236274793066b9ba3154b16c0acc1c891e5c
usb: chipidea: Refactor USB PHY selection and keep a single PHY

Refactor the code in charge of looking up the USB PHY when no platdata
is provided. Attempt to get a generic USB PHY first, then look for a
legacy USB PHY through device-tree and finally get any registered PHY
with the correct type.

This way, only a single USB PHY is obtained and the flow is easier to
understand and follow.

All error pointers (except for EPROBE_DEFER) are considered as PHY
not found.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/core.c