UPSTREAM: USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block
authorHans de Goede <hdegoede@redhat.com>
Fri, 10 Jun 2016 09:46:25 +0000 (11:46 +0200)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 12 Sep 2016 03:18:54 +0000 (11:18 +0800)
commita905504e41e5f1274732f9bf0089c55c26b53e8e
tree4ecdac34ef7b4ff6cd6ebf3d6248f80af8b0d205
parent8fdfae6cb796865ef2d6eb0a5d15237f41ca7d5a
UPSTREAM: USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block

Some SoCs have a single phy-hw-block with multiple phys, this is
modelled by a single phy dts node, so we end up with multiple
controller nodes with a phys property pointing to the phy-node
of the otg-phy.

Only one of these controllers typically is an otg controller, yet we
were checking the first controller who uses a phy from the block and
then end up looking for a dr_mode property in e.g. the ehci controller.

This commit fixes this by adding an arg0 parameter to
of_usb_get_dr_mode_by_phy and make of_usb_get_dr_mode_by_phy
check that this matches the phandle args[0] value when looking for
the otg controller.

Conflicts:
drivers/usb/phy/phy-am335x.c

Change-Id: I0b999a7445399cb2c86060bdf662db8aab96d1cc
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit ce15ed4c5dfb3f7757e6611902aed5db253af977)
drivers/usb/common/common.c
include/linux/usb/of.h