usb: Change usb_of_get_companion_dev() place to usb/common
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 20 Aug 2018 03:10:26 +0000 (12:10 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 18:40:29 +0000 (20:40 +0200)
commitfa827966090e2a6fc07b437d0d2ffae748ec6e28
treeb415fe1dd8e8574cc4f8cf45391b325556a990d4
parent0a3b53305c8ff427bbc1d9d5bd78524007f19600
usb: Change usb_of_get_companion_dev() place to usb/common

Since renesas_usb3 udc driver calls usb_of_get_companion_dev()
which is on usb/core/of.c, build error like below happens if we
disable CONFIG_USB because the usb/core/ needs CONFIG_USB:

ERROR: "usb_of_get_companion_dev" [drivers/usb/gadget/udc/renesas_usb3.ko] undefined!

According to the usb/gadget/Kconfig, "NOTE:  Gadget support
** DOES NOT ** depend on host-side CONFIG_USB !!".
So, to fix the issue, this patch changes the usb_of_get_companion_dev()
place from usb/core/of.c to usb/common/common.c to be called by both
host and gadget.

Reported-by: John Garry <john.garry@huawei.com>
Fixes: 39facfa01c9f ("usb: gadget: udc: renesas_usb3: Add register of usb role switch")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/common/common.c
drivers/usb/core/of.c