Skip to contentSkip to conversation

serial: 8250_ce4100: Fix CONFIG_SERIAL_8250=n build

PATCH In review Andy Shevchenko 2 participants 2 messages Jul 16, 2025 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 serial: 8250_ce4100: Fix CONFIG_SERIAL_8250=n build

On i386, when

CONFIG_X86_INTEL_CE=y
# CONFIG_SERIAL_8250 is not set

it will try to compile the driver and use the stub simultaneously. This breaks the build. Fix it by making sure that the driver compiles only when CONFIG_SERIAL_8250 is also enabled.

On top of that ensure that CONFIG_SERIAL_8250 is actually set to 'y' and not 'm' as the later makes no sense for this platform. The hook may only be applied during early boot.

Fixes acc902de05b2 ("serial: 8250: Move CE4100 quirks to a module under 8250 driver")
Fixes 5ec6960f6f0c ("ce4100: Add errata fixes for UART on CE4100")

---

v2: made the fix more readable (Jiri)

 drivers/tty/serial/8250/Makefile | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/8250/Makefile +2 -0
index e61dc3f4ca50..513a0941c284 100644
@@ -24,7 +24,9 @@ obj-$(CONFIG_SERIAL_8250_ASPEED_VUART)	+= 8250_aspeed_vuart.o
 obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
 obj-$(CONFIG_SERIAL_8250_BCM7271)	+= 8250_bcm7271.o
 obj-$(CONFIG_SERIAL_8250_BOCA)		+= 8250_boca.o
+ifeq ($(CONFIG_SERIAL_8250),y)
 obj-$(CONFIG_X86_INTEL_CE)		+= 8250_ce4100.o
+endif
 obj-$(CONFIG_SERIAL_8250_DFL)		+= 8250_dfl.o
 obj-$(CONFIG_SERIAL_8250_DW)		+= 8250_dw.o
 obj-$(CONFIG_SERIAL_8250_EM)		+= 8250_em.o
Signature · 1 line
2.47.2
Acked-by Tested-by on v2 1/1
#1 lore raw
Quoted 13 lines · Andy Shevchenko

On i386, when

CONFIG_X86_INTEL_CE=y
# CONFIG_SERIAL_8250 is not set

it will try to compile the driver and use the stub simultaneously. This breaks the build. Fix it by making sure that the driver compiles only when CONFIG_SERIAL_8250 is also enabled.

On top of that ensure that CONFIG_SERIAL_8250 is actually set to 'y' and not 'm' as the later makes no sense for this platform. The hook may only be applied during early boot.

Quoted 5 lines
Fixes acc902de05b2 ("serial: 8250: Move CE4100 quirks to a module under 8250 driver")
Fixes 5ec6960f6f0c ("ce4100: Add errata fixes for UART on CE4100")

This solution works but it seems quite hidden to me. I would rather see a Kconfig solution, like Jiri mentioned.

Anyway,

Thanks.

Quoted 21 lines

---

v2: made the fix more readable (Jiri)

 drivers/tty/serial/8250/Makefile | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/8250/Makefile +2 -0
index e61dc3f4ca50..513a0941c284 100644
@@ -24,7 +24,9 @@ obj-$(CONFIG_SERIAL_8250_ASPEED_VUART)	+= 8250_aspeed_vuart.o
 obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
 obj-$(CONFIG_SERIAL_8250_BCM7271)	+= 8250_bcm7271.o
 obj-$(CONFIG_SERIAL_8250_BOCA)		+= 8250_boca.o
+ifeq ($(CONFIG_SERIAL_8250),y)
 obj-$(CONFIG_X86_INTEL_CE)		+= 8250_ce4100.o
+endif
 obj-$(CONFIG_SERIAL_8250_DFL)		+= 8250_dfl.o
 obj-$(CONFIG_SERIAL_8250_DW)		+= 8250_dw.o
 obj-$(CONFIG_SERIAL_8250_EM)		+= 8250_em.o
Signature · 1 line
~Randy