Re: [PATCH 1/2] tty: serial: remove hub6 multiport support

From: Andy Shevchenko

Date: Mon Oct 19 2026 - 04:16:34 EST


On Fri, Oct 16, 2026 at 12:48:39PM -0400, Hugo Villeneuve wrote:
> On Fri, 16 Oct 2026 14:59:47 +0200
> Arnd Bergmann <arnd@xxxxxxxxxx> wrote:

...

> > switch (up->port.iotype) {
> > - case UPIO_HUB6:
> > - outb(up->port.hub6 - 1 + offset, up->port.iobase);
> > - return inb(up->port.iobase + 1);
> > -
> > case UPIO_MEM:
> > return readb(up->port.membase + offset);
>
> Maybe change to a simple if/else?
>
> if (up->port.iotype == UPIO_MEM)
> return readb(up->port.membase + offset);
> else
> return inb(up->port.iobase + offset);

While it may work, I would still leave a possibility of the default case, but
Ideally this should be a simple callback level change, so it will be checked
only once at the probe time or so.

...

> > offset <<= up->port.regshift;
> >
> > switch (up->port.iotype) {
> > - case UPIO_HUB6:
> > - outb(up->port.hub6 - 1 + offset, up->port.iobase);
> > - outb(value, up->port.iobase + 1);
> > - break;
> > -
> > case UPIO_MEM:
> > writeb(value, up->port.membase + offset);
> > break;
>
> Similar here:
>
> if (up->port.iotype == UPIO_MEM)
> writeb(value, up->port.membase + offset);
> else
> outb(value, up->port.iobase + offset);

Same here, see how we assign the respective callbacks in the 8250, for instance.

--
With Best Regards,
Andy Shevchenko