public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Greg Ungerer <gerg@snapgear.com>
Cc: torvalds@linux-foundation.org, gerg@uclinux.org,
	linux-kernel@vger.kernel.org
Subject: Re: [M68KNOMMU]: new style ColdFire UART driver
Date: Fri, 26 Oct 2007 14:23:28 -0700	[thread overview]
Message-ID: <20071026142328.d06a1b3b.akpm@linux-foundation.org> (raw)
In-Reply-To: <200710190142.l9J1gfxk003771@goober>

On Fri, 19 Oct 2007 11:42:41 +1000
Greg Ungerer <gerg@snapgear.com> wrote:

> A new style serial driver for the Freescale ColdFire UART to replace
> the old style one currently in the tree (drivers/serial/mcfserial.c).
> 
> Currently this UART is only found in the ColdFire CPU family of parts
> (thus I prefixed this patch [M68KNOMMU]).
> 
> This has been around for a long while now, tested on all available
> platforms.
> 
> ...
>

All of these:

> +/****************************************************************************/

don't really add much value.

> +static unsigned int mcf_get_mctrl(struct uart_port *port)
> +{
> +	struct mcf_uart *pp = (struct mcf_uart *) port;

container_of() would be nicer: it explains what's going on and removes the
unpleasing requirement that uart_port be the first member of mcf_uart.

> +static void mcf_set_mctrl(struct uart_port *port, unsigned int sigs)
> +{
> +	struct mcf_uart *pp = (struct mcf_uart *) port;

Many instances..

> +static void mcf_set_termios(struct uart_port *port, struct ktermios *termios,
> +	struct ktermios *old)
> +{
> +	unsigned long flags;
> +	unsigned int baud, baudclk;
> +	unsigned char mr1, mr2;

Is this all up-to-date with Alan's recent termios changes?

> +static struct mcf_uart mcf_ports[3];
> +
> +#define	MCF_MAXPORTS	(sizeof(mcf_ports) / sizeof(struct mcf_uart))

Use ARRAY_SIZE here.

> +/****************************************************************************/
> +#if defined(CONFIG_SERIAL_MCF_CONSOLE)
> +/****************************************************************************/
> +
> +int __init early_mcf_setup(struct mcf_platform_uart *platp)

hrm, this is global and has no callers.

> +{
> +	struct uart_port *port;
> +	int i;
> +
> +	for (i = 0; ((i < MCF_MAXPORTS) && (platp[i].mapbase)); i++) {
> +		port = &mcf_ports[i].port;
> +
> +		port->line = i;
> +		port->type = PORT_MCF;
> +		port->mapbase = platp[i].mapbase;
> +		port->membase = (platp[i].membase) ? platp[i].membase :
> +			(unsigned char __iomem *) port->mapbase;
> +		port->iotype = SERIAL_IO_MEM;
> +		port->irq = platp[i].irq;
> +		port->uartclk = MCF_BUSCLK;
> +		port->flags = ASYNC_BOOT_AUTOCONF;
> +		port->ops = &mcf_uart_ops;
> +	}
> +
> +	return 0;
> +}
> +


  reply	other threads:[~2007-10-26 21:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19  1:42 [M68KNOMMU]: new style ColdFire UART driver Greg Ungerer
2007-10-26 21:23 ` Andrew Morton [this message]
2007-10-29  2:56   ` Greg Ungerer
  -- strict thread matches above, loose matches on Subject: below --
2007-10-23  4:37 Greg Ungerer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071026142328.d06a1b3b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=gerg@snapgear.com \
    --cc=gerg@uclinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox