From 54f034f48ce3e41db7b0b6bd12957a3ef4132d13 Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Fri, 8 May 2020 11:58:07 -0700 Subject: [PATCH] usb: gadget: Allow f_rndis and f_gsi to coexist as modules Currently the make targets for CONFIG_USB_F_RNDIS and CONFIG_USB_F_GSI both include rndis.o. This would work if only one is enabled, or both are enabled as =Y as rndis.o will get linked into the vmlinux image once. Otherwise if both are enabled with at least one as a module, it results in a module load failure due to duplicate symbols. A simple fix for this is to let the usb_f_gsi.o module only include rndis.o if CONFIG_USB_F_RNDIS is disabled. Change-Id: Id5b96aaa9a728aa26a65b2c66f2341d6e2fb786b Signed-off-by: Jack Pham --- drivers/usb/gadget/function/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/Makefile b/drivers/usb/gadget/function/Makefile index 5bb589582cd9..3af4a24d322c 100644 --- a/drivers/usb/gadget/function/Makefile +++ b/drivers/usb/gadget/function/Makefile @@ -62,5 +62,8 @@ usb_f_ccid-y := f_ccid.o obj-$(CONFIG_USB_F_CCID) += usb_f_ccid.o usb_f_cdev-y := f_cdev.o obj-$(CONFIG_USB_F_CDEV) += usb_f_cdev.o -usb_f_gsi-y := f_gsi.o rndis.o +usb_f_gsi-y := f_gsi.o +ifeq ($(CONFIG_USB_F_RNDIS),) +usb_f_gsi-y += rndis.o +endif obj-$(CONFIG_USB_F_GSI) += usb_f_gsi.o