[SRU][B][PATCH 4/4] UBUNTU: SAUCE: xr-usb-serial: fix kbuild

Shrirang Bagul shrirang.bagul at canonical.com
Wed Feb 19 04:38:05 UTC 2020


BugLink: https://bugs.launchpad.net/bugs/1863834

Build Exar USB serial driver only on X86 platforms.

linux-oem buglink: https://launchpad.net/bugs/1645591

Signed-off-by: Shrirang Bagul <shrirang.bagul at canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen at canonical.com>
(cherry picked from commit cae008a0a044d2e0e5fbeade6047dc9c2d790796)
(source tag: Ubuntu-oem-4.15.0-1073.83)
Signed-off-by: Shrirang Bagul <shrirang.bagul at canonical.com>
---
 ubuntu/xr-usb-serial/Kconfig                | 11 +++++++++++
 ubuntu/xr-usb-serial/Makefile               | 15 +--------------
 ubuntu/xr-usb-serial/xr_usb_serial_common.h |  3 +++
 3 files changed, 15 insertions(+), 14 deletions(-)
 create mode 100644 ubuntu/xr-usb-serial/Kconfig

diff --git a/ubuntu/xr-usb-serial/Kconfig b/ubuntu/xr-usb-serial/Kconfig
new file mode 100644
index 000000000000..d563a28fde6b
--- /dev/null
+++ b/ubuntu/xr-usb-serial/Kconfig
@@ -0,0 +1,11 @@
+config USB_SERIAL_EXAR
+	bool "Exar USB UART (serial port) driver"
+	depends on X86 || X86_64
+	depends on TTY
+	depends on GPIOLIB
+	default y
+	---help---
+	  Say Y here if you want to use a Exar USB to Serial device.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called xr_usb_serial
diff --git a/ubuntu/xr-usb-serial/Makefile b/ubuntu/xr-usb-serial/Makefile
index 533988cede12..75eebc0725f7 100644
--- a/ubuntu/xr-usb-serial/Makefile
+++ b/ubuntu/xr-usb-serial/Makefile
@@ -1,16 +1,3 @@
 obj-m := xr_usb_serial_common.o
 
-#KERNELDIR ?= /lib/modules/$(shell uname -r)/build
-KERNELDIR ?=$(shell pwd)/../parts/kernel/build
-PWD       := $(shell pwd)
-
-EXTRA_CFLAGS	:= -DDEBUG=0
-
-all:
-	$(MAKE) -C $(KERNELDIR) M=$(PWD)
-
-modules_install:
-	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
-
-clean:
-	rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions vtty
+obj-$(CONFIG_USB_SERIAL_EXAR)			+= xr_usb_serial_common.o
diff --git a/ubuntu/xr-usb-serial/xr_usb_serial_common.h b/ubuntu/xr-usb-serial/xr_usb_serial_common.h
index d462bb5751a4..7e5ccf1da4e2 100644
--- a/ubuntu/xr-usb-serial/xr_usb_serial_common.h
+++ b/ubuntu/xr-usb-serial/xr_usb_serial_common.h
@@ -15,6 +15,9 @@
  */
 
 #include <linux/gpio/driver.h>
+#include <linux/usb/cdc.h>
+#include <linux/usb.h>
+#include <linux/tty.h>
 /*
  * CMSPAR, some architectures can't have space and mark parity.
  */
-- 
2.17.1




More information about the kernel-team mailing list