linux-mips
[Top] [All Lists]

Re: [PATCH 3/4] serial_txx9 driver support

To: frank.rowand@am.sony.com
Subject: Re: [PATCH 3/4] serial_txx9 driver support
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 17 Jan 2008 00:47:16 +0900 (JST)
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <1200436432.4092.38.camel@bx740>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1200436139.4092.30.camel@bx740> <1200436432.4092.38.camel@bx740>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 15 Jan 2008 14:33:52 -0800, Frank Rowand <frank.rowand@am.sony.com> 
wrote:
> Add polled debug driver support to serial_txx9.c for kgdb, and initialize
> the driver for the Toshiba RBTX4927.

I think Jason Wessel's kgdb patchset is a way to go.

Anyway, some comments below.

> +int kgdb_initialized;

Should be static.

> +void txx9_sio_kgdb_hook(unsigned int port, unsigned int baud_rate)

Should be static.  The baud_rate is not used.

> +void
> +txx9_sio_kdbg_init(unsigned int port_number)
> +{
> +     if (port_number == 1) {
> +             txx9_sio_kgdb_hook(port_number, 38400);
> +             kgdb_initialized = 1;
> +     } else {
> +             printk(KERN_ERR
> +                     "txx9_sio_kdbg_init(): Bad Port Number [%u] != [1]\n",
> +                     port_number);
> +     }
> +
> +     return;
> +}

Why port_number other than 1 is bad?

The "return" at the end of the function is redundant.

> +u8
> +txx9_sio_kdbg_rd(void)
> +{
> +     unsigned int status, ch;
> +     struct uart_txx9_port *up = &serial_txx9_ports[1];

Oh this assumes port number 1.  The gdb port number should be customizable.

> +                     sio_out(up, TXX9_SITFIFO, (u32)ch);

The cast is not needed.

---
Atsushi Nemoto

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