serial: 8250: Move CE4100 quirks to a module under 8250 driver
Subsystems (2)
PATCH 1/1 serial: 8250: Move CE4100 quirks to a module under 8250 driver
There is inconvenient for maintainers and maintainership to have some quirks under architectural code. Move it to the specific quirk file like other 8250-compatible drivers do.
---
The next step can be considered on how to get rid of serial8250_set_isa_configurator() ugly hook.
arch/x86/include/asm/ce4100.h | 6 ++ arch/x86/platform/ce4100/ce4100.c | 98 ------------------- .../tty/serial/8250/8250_ce4100.c | 92 +++-------------- drivers/tty/serial/8250/Makefile | 1 + 4 files changed, 23 insertions(+), 174 deletions(-) copy arch/x86/platform/ce4100/ce4100.c => drivers/tty/serial/8250/8250_ce4100.c (51%)
arch/x86/include/asm/ce4100.h +6 -0
@@ -4,4 +4,10 @@int ce4100_pci_init (void ); +#ifdef CONFIG_SERIAL_8250 +void __init sdv_serial_fixup (void ); +#else +static inline void sdv_serial_fixup (void ) {}; +#endif +#endif
arch/x86/platform/ce4100/ce4100.c +0 -98
116 lines not on this page · raw message
drivers/tty/serial/8250/8250_ce4100.c renamed from arch/x86/platform/ce4100/ce4100.c +16 -76
129 lines not on this page · raw message
drivers/tty/serial/8250/Makefile +1 -0
@@ -24,6 +24,7 @@ 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 +obj-$(CONFIG_X86_INTEL_CE) += 8250_ce4100.o 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
Quoted 5 lines · Andy Shevchenko
There is inconvenient for maintainers and maintainership to have some quirks under architectural code. Move it to the specific quirk file like other 8250-compatible drivers do.
Signed-off-by Andy Shevchenko <[email protected]>
Nice.
Just two nits (one suggestion actually) below. Ignore if you won't resubmit for some other reasons...
arch/x86/include/asm/ce4100.h line 10
Quoted 10 lines
arch/x86/include/asm/ce4100.h +4
-0@@ -4,4 +4,10 @@int ce4100_pci_init (void ); +#ifdef CONFIG_SERIAL_8250 +void __init sdv_serial_fixup (void ); +#else +static inline void sdv_serial_fixup (void ) {};
Superfluous ;.
Quoted 5 lines
arch/x86/include/asm/ce4100.h +2
-0+#endif +#endif arch/x86/platform/ce4100/ce4100.c +0
-0
...
Quoted 1 line
arch/x86/platform/ce4100/ce4100.c +0
-0@@ -31,97 +24,6 @@ static void ce4100_power_off(void)
...
arch/x86/platform/ce4100/ce4100.c static void ce4100_power_off(void) · line 61
Quoted 10 lines
arch/x86/platform/ce4100/ce4100.c +0
-10-static u32 ce4100_mem_serial_in (struct uart_port *p,unsigned int offset) -{ -u32 ret, ier, lsr; - -if (offset !=UART_IIR ) -return mem_serial_in (p, offset); - - offset <<= p->regshift; - - ret =readl (p->membase + offset);
Just noticed: why the two above lines are not one:
ret = mem_serial_in()?
Or in fact the whole function intro:
ret = mem_serial_in(p, offset);
if (offset != UART_IIR)
return ret;
thanks,
Signature · 2 lines
js suse labs
Quoted 10 lines · Jiri Slaby
Quoted 5 lines · Andy Shevchenko
There is inconvenient for maintainers and maintainership to have some quirks under architectural code. Move it to the specific quirk file like other 8250-compatible drivers do.
Signed-off-by Andy Shevchenko <[email protected]>Nice.
Reviewed-by Jiri Slaby <[email protected]>
Thanks, but it seems a bit late :-)
Quoted 2 lines
Just two nits (one suggestion actually) below. Ignore if you won't resubmit for some other reasons...
Sure, see above.
...
Quoted 3 lines
Quoted 1 line
+static inline void
sdv_serial_fixup(void){};Superfluous ;.
Indeed. But I don't want to update just this (as it now may require a separate change for x86).
...
Quoted 14 lines
arch/x86/platform/ce4100/ce4100.c static void ce4100_power_off(void) · line 61
Quoted 10 lines
arch/x86/platform/ce4100/ce4100.c +0
-10-static u32 ce4100_mem_serial_in (struct uart_port *p,unsigned int offset) -{ -u32 ret, ier, lsr; - -if (offset !=UART_IIR ) -return mem_serial_in (p, offset); - - offset <<= p->regshift; - - ret =readl (p->membase + offset);Just noticed: why the two above lines are not one:
ret =mem_serial_in()?
Quoted 4 lines
Or in fact the whole function intro:
ret =mem_serial_in(p, offset);
if (offset !=UART_IIR)
return ret;
Hmm... Sounds like an equivalent. I probably can send a followup for this suggestion.
Signature · 2 lines
With Best Regards, Andy Shevchenko