linux-mips
[Top] [All Lists]

Re: [PATCH] serial: Add Cavium OCTEON UART definitions.

To: David Daney <ddaney@caviumnetworks.com>
Subject: Re: [PATCH] serial: Add Cavium OCTEON UART definitions.
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 7 Oct 2008 11:34:50 +0200
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, "Paoletti, Tomaso" <Tomaso.Paoletti@caviumnetworks.com>
In-reply-to: <48EAAF97.8050307@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <48EAAF97.8050307@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: KMail/1.9.9
On Tuesday 07 October 2008, David Daney wrote:
> 
> -       up->port.type = PORT_16550A;
> +#ifdef CONFIG_CPU_CAVIUM_OCTEON
> +       /* UPF_FIXED_PORT indicates an internal UART.  */
> +       if (up->port.flags & UPF_FIXED_PORT)
> +               up->port.type = PORT_OCTEON;
> +       else
> +#endif
> +               up->port.type = PORT_16550A;
> +

This looks somewhat wrong, IMHO a device driver should not assume that
a CONFIG_CPU_* symbol is exclusive. You could have (maybe not now, but
in the future) a kernel that supports running on an Octeon as well
as some other Mips64 processor, and have UPF_FIXED_PORT uart on some
other machine, which will make the kernel think it is a PORT_OCTEON.

        Arnd <><

<Prev in Thread] Current Thread [Next in Thread>