Re: [PATCH] 8250-men-mcb: add support for 16z025 and 16z057

From: Andy Shevchenko
Date: Tue Feb 27 2018 - 12:57:40 EST


On Tue, Feb 27, 2018 at 5:31 PM, Michael Moese <mmoese@xxxxxxx> wrote:
> Add support for two MEN UARTs (16z025 and 16z057) to the
> 8250_men_mcb driver.
> The 16z025 consists of up to four ports, the 16z057 has
> exactly four ports. Apart from that, all of them share the
> Port settings.

> - else if (strncmp(mdev->bus->name, "F216", 4) == 0)
> + else if (strncmp(mdev->bus->name, "F216", 4) == 0)

What's changed?

> clkval = 1843200;


> + switch (mdev->id) {
> + case MEN_UART_ID_Z125:
> + num_ports = 1U;
> + break;
> + case MEN_UART_ID_Z025:
> + num_ports = readb(membase) >> 4;
> + break;
> + case MEN_UART_ID_Z057:
> + num_ports = 4U;
> + break;
> + default:
> + dev_err(&mdev->dev, "no supported device!\n");
> + return -ENODEV;
> + }

(1)

> + data[i].uart.port.mapbase = (unsigned long) mem->start
> + + (i * MEN_UART_MEM_SIZE);

Redundant parens.


> + switch (mdev->id) {
> + case MEN_UART_ID_Z125:
> + num_ports = 1U;
> + break;
> + case MEN_UART_ID_Z025:
> + num_ports = readb(data[0].uart.port.membase) >> 4;
> + break;
> + case MEN_UART_ID_Z057:
> + num_ports = 4U;
> + break;
> + default:
> + dev_err(&mdev->dev, "no supported device!\n");
> + return;
> + }

Can you deduplicate this with (1)?


--
With Best Regards,
Andy Shevchenko