Re: serial drivers polishing

From: Christophe Leroy
Date: Mon Apr 29 2019 - 12:18:38 EST


Hi,

On 04/27/2019 12:51 PM, Enrico Weigelt, metux IT consult wrote:
Hello folks,


here's another attempt of polishing the serial drivers:

* lots of minor cleanups to make checkpatch happier
(eg. formatting, includes, inttypes, ...)

* use appropriate logging helpers instead of printk()

* consequent use of mapsize/mapbase fields:
the basic idea is, all drivers should fill mapbase/mapbase fields at
init time and later only use those fields, instead of hardcoded values
(later on, we can add generic helpers for the map/unmap stuff, etc)

* untwisting serial8250_port_size() at all:
move the iomem size probing to initialization time, move out some
platform specific magic to corresponding platform code, etc.


Unfortunately, I don't have the actual hardware to really test all
the code, so please let me know if there's something broken in here.


have fun,

--mtx



Got the following build error while compiling for my powerpc board with your full series applied. No time to investigate though.

CC arch/powerpc/kernel/setup-common.o
In file included from ./include/linux/serial_8250.h:14:0,
from arch/powerpc/kernel/setup-common.c:33:
./include/linux/serial_core.h: In function âuart_memres_set_resâ:
./include/linux/serial_core.h:446:18: error: âresourceâ undeclared (first use in this function)
port->iobase = resource->start;
^
./include/linux/serial_core.h:446:18: note: each undeclared identifier is reported only once for each function it appears in
./include/linux/serial_core.h:450:2: error: âuartâ undeclared (first use in this function)
uart->mapbase = res->start;
^
./include/linux/serial_core.h: In function âuart_memres_set_start_lenâ:
./include/linux/serial_core.h:464:6: error: âstruct uart_driverâ has no member named âmapbaseâ
uart->mapbase = start;
^
./include/linux/serial_core.h:465:6: error: âstruct uart_driverâ has no member named âmapsizeâ
uart->mapsize = len;
^
./include/linux/serial_core.h:466:6: error: âstruct uart_driverâ has no member named âiotypeâ
uart->iotype = UPIO_MEM;
^
make[3]: *** [arch/powerpc/kernel/setup-common.o] Error 1


Christophe