On Mon, Mar 5, 2018 at 10:22 AM, Michael Moese <[email protected]> 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.

> Changes to v2:
> Added include of linux/io.h due to finding of kbuild robot.

Hmm... Is it there?

>  static int serial_8250_men_mcb_probe(struct mcb_device *mdev,
>                                      const struct mcb_device_id *id)
>  {

>         mem = mcb_get_resource(mdev, IORESOURCE_MEM);

>         if (mem == NULL)
>                 return -ENXIO;

Redundant.

> +       membase = devm_ioremap_resource(&mdev->dev, mem);
> +       if (IS_ERR(membase))
> +               return PTR_ERR_OR_ZERO(membase);

> +       for (i = 0; i < num_ports; i++) {

> +               /* ok, register the port */
> +               data[i].line = serial8250_register_8250_port(&data[i].uart);
> +               if (data[i].line < 0) {
> +                       dev_err(&mdev->dev, "unable to register UART port\n");
> +                       return data[i].line;
> +               }
> +               dev_info(&mdev->dev, "found MCB UART: ttyS%d\n", 
> data[i].line);

Consider to use  struct uart_port::name instead.

> +       }
>
>         return 0;
>  }
>
>  static void serial_8250_men_mcb_remove(struct mcb_device *mdev)
>  {

> +       if (!data)
> +               return;

When it's possible?

>  }

-- 
With Best Regards,
Andy Shevchenko

Reply via email to