Re: [PATCH] usb: always build usb/common/ targets; fixes extcon-axp288 build error
From: Randy Dunlap
Date: Wed Apr 18 2018 - 02:31:13 EST
On 04/17/18 02:01, Hans de Goede wrote:
> Hi,
>
> On 17-04-18 07:14, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
>>
>> The extcon-axp288 driver selects USB_ROLE_SWITCH, but the USB
>> Makefile does not currently build drivers/usb/common/ (where
>> USB_ROLE_SWITCH code is) unless USB_COMMON is set, so modify
>> the USB Makefile to always descend into drivers/usb/common/
>> to build its configured targets.
>>
>> Fixes these build errors:
>>
>> ERROR: "usb_role_switch_get" [drivers/extcon/extcon-axp288.ko] undefined!
>> ERROR: "usb_role_switch_set_role" [drivers/extcon/extcon-axp288.ko] undefined!
>> ERROR: "usb_role_switch_get_role" [drivers/extcon/extcon-axp288.ko] undefined!
>> ERROR: "usb_role_switch_put" [drivers/extcon/extcon-axp288.ko] undefined!
>>
>> An alternative patch would be to select USB_COMMON in the EXTCON_AXP288
>> driver Kconfig entry, but this would build more code in
>> drivers/usb/common/ than is necessary.
>
> Ah, that variant of fixing this got posted yesterday and I acked that,
> but I agree that this version is better.
That was my first patch version, but I didn't like it.
However, I missed that patch. If I had seen it, I wouldn't have posted
this patch.
> Greg, what is your take on this fix?
>
> Chanwoo Choi, please wait with merging the fix from yesterday until
> we've a decision which fix to use.
>
> Regards,
>
> Hans
>
>
>
>>
>> Reported-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
>> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
>> Cc: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>
>> Cc: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
>> Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
>> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>> Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
>> Cc: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
>> Cc: linux-usb@xxxxxxxxxxxxxxx
>> ---
>> Â drivers/usb/Makefile |ÂÂÂ 2 +-
>> Â 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- lnx-417-rc1.orig/drivers/usb/Makefile
>> +++ lnx-417-rc1/drivers/usb/Makefile
>> @@ -60,7 +60,7 @@ obj-$(CONFIG_USB_CHIPIDEA)ÂÂÂ += chipidea/
>> Â obj-$(CONFIG_USB_RENESAS_USBHS)ÂÂÂ += renesas_usbhs/
>> Â obj-$(CONFIG_USB_GADGET)ÂÂÂ += gadget/
>> Â -obj-$(CONFIG_USB_COMMON)ÂÂÂ += common/
>> +obj-yÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ += common/
>> Â Â obj-$(CONFIG_USBIP_CORE)ÂÂÂ += usbip/
>> Â
>>
>
--
~Randy