All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Mallon <ryan@bluewatersys.com>
To: Brian Swetland <swetland@google.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-kernel@vger.kernel.org, pavel@ucw.cz,
	Robert Love <rlove@google.com>
Subject: Re: [PATCH 1/3] [ARM] msm_serial: serial driver for MSM7K onboard serial	peripheral.
Date: Mon, 15 Jun 2009 15:18:23 +1200	[thread overview]
Message-ID: <4A35BD7F.3020803@bluewatersys.com> (raw)
In-Reply-To: <1245033557-10968-2-git-send-email-swetland@google.com>

Brian Swetland wrote:
> From: Robert Love <rlove@google.com>
> 
> Signed-off-by: Brian Swetland <swetland@google.com>

Hi Brian, some comments below:

> +
> +struct msm_port {
> +	struct uart_port	uart;
> +	char			name[16];
> +	struct clk		*clk;
> +	unsigned int		imr;
> +};
> +
> +#define UART_TO_MSM(uart_port)	((struct msm_port *) uart_port)

Should this be:

#define to_msm_uart(up) container_of(up, msm_port, uart_port)

Container conversion macros are usually lower case.

> +static int msm_startup(struct uart_port *port)
> +{
> +	struct msm_port *msm_port = UART_TO_MSM(port);
> +	unsigned int data, rfr_level;
> +	int ret;
> +
> +	snprintf(msm_port->name, sizeof(msm_port->name),
> +		 "msm_serial%d", port->line);
> +
> +	ret = request_irq(port->irq, msm_irq, IRQF_TRIGGER_HIGH,
> +			  msm_port->name, port);
> +	if (unlikely(ret))
> +		return ret;

Not sure that you need the likely/unlikely macros here or in the other
startup/release functions. They are usually for hot-path code. They
aren't strictly wrong, its just probably not necessary.

> +
> +static struct uart_ops msm_uart_pops = {
> +	.tx_empty = msm_tx_empty,
> +	.set_mctrl = msm_set_mctrl,
> +	.get_mctrl = msm_get_mctrl,
> +	.stop_tx = msm_stop_tx,
> +	.start_tx = msm_start_tx,
> +	.stop_rx = msm_stop_rx,
> +	.enable_ms = msm_enable_ms,
> +	.break_ctl = msm_break_ctl,
> +	.startup = msm_startup,
> +	.shutdown = msm_shutdown,
> +	.set_termios = msm_set_termios,
> +	.type = msm_type,
> +	.release_port = msm_release_port,
> +	.request_port = msm_request_port,
> +	.config_port = msm_config_port,
> +	.verify_port = msm_verify_port,
> +	.pm = msm_power,
> +};

Tab-delimit this to make it look nicer, ie:

	.tx_empty	= msm_tx_empty,
	.set_mctrl	= msm_set_mctrl,
	...

> +
> +static struct msm_port msm_uart_ports[] = {
> +	{
> +		.uart = {
> +			.iotype = UPIO_MEM,
> +			.ops = &msm_uart_pops,
> +			.flags = UPF_BOOT_AUTOCONF,
> +			.fifosize = 512,
> +			.line = 0,
> +		},

Same here, and all the other struct initialisations.

> +
> +static int __init msm_console_setup(struct console *co, char *options)
> +{
> +	struct uart_port *port;
> +	int baud, flow, bits, parity;
> +
> +	if (unlikely(co->index >= UART_NR || co->index < 0))
> +		return -ENXIO;
> +
> +	port = get_port_from_line(co->index);
> +
> +	if (unlikely(!port->membase))
> +		return -ENXIO;
> +
> +	port->cons = co;
> +
> +	msm_init_clock(port);
> +
> +	if (options)
> +		uart_parse_options(options, &baud, &parity, &bits, &flow);
> +
> +	bits = 8;
> +	parity = 'n';
> +	flow = 'n';
> +	msm_write(port, UART_MR2_BITS_PER_CHAR_8 | UART_MR2_STOP_BIT_LEN_ONE,
> +		  UART_MR2);	/* 8N1 */
> +
> +	if (baud < 300 || baud > 115200)
> +		baud = 115200;

return -EINVAL?

> +	msm_set_baud_rate(port, baud);
> +
> +	msm_reset(port);
> +
> +	printk(KERN_INFO "msm_serial: console setup on port #%d\n", port->line);

pr_info? Also, this may just be noise, IIRC, the serial sub-system
prints information about the uarts anyway.

~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

       Ryan Mallon                              Unit 5, Amuri Park
       Phone: +64 3 3779127                     404 Barbadoes St
       Fax:   +64 3 3779135                     PO Box 13 889
       Email: ryan@bluewatersys.com             Christchurch, 8013
       Web:   http://www.bluewatersys.com       New Zealand
       Freecall Australia  1800 148 751         USA 1800 261 2934

  parent reply	other threads:[~2009-06-15  3:21 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15  2:39 Patches to get serial working on msm7k / htc dream Brian Swetland
2009-06-15  2:39 ` [PATCH 1/3] [ARM] msm_serial: serial driver for MSM7K onboard serial peripheral Brian Swetland
2009-06-15  2:39   ` [PATCH 2/3] [ARM] msm: make debugging UART (for DEBUG_LL) configurable Brian Swetland
2009-06-15  2:39     ` [PATCH 3/3] [ARM] msm: add minimal board file for HTC Dream device Brian Swetland
2009-06-15  6:42       ` Stefan Schmidt
2009-06-15  6:51         ` Brian Swetland
2009-06-15  7:15           ` Stefan Schmidt
2009-06-15 13:22       ` Pavel Machek
2009-06-15 18:25         ` Brian Swetland
2009-06-15 18:28           ` Pavel Machek
2009-06-15 18:51             ` Brian Swetland
2009-06-24 20:56               ` Pavel Machek
2009-06-25 13:55                 ` Russell King - ARM Linux
2009-06-25 14:33                   ` Alan Cox
2009-06-25 19:31                   ` Brian Swetland
2009-06-25 20:46                     ` Russell King - ARM Linux
2009-06-15 13:20     ` [PATCH 2/3] [ARM] msm: make debugging UART (for DEBUG_LL) configurable Pavel Machek
2009-06-15 18:30       ` Brian Swetland
2009-06-15 18:34         ` Pavel Machek
2009-06-15 18:43           ` Brian Swetland
2009-06-15 18:50             ` Pavel Machek
2009-06-15  3:18   ` Ryan Mallon [this message]
2009-06-15  8:54     ` [PATCH 1/3] [ARM] msm_serial: serial driver for MSM7K onboard serial peripheral Alan Cox
2009-06-15  8:52   ` Pavel Machek
2009-06-15  8:58     ` Russell King - ARM Linux
2009-06-15  9:55     ` Brian Swetland
2009-06-16  7:35       ` Russell King - ARM Linux
2009-06-15  8:52   ` Alan Cox
2009-06-17  3:07     ` Brian Swetland
2009-06-15  9:05   ` Linus Walleij
2009-06-17 12:17   ` Robert Love
2009-06-15  8:40 ` Patches to get serial working on msm7k / htc dream Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2009-06-18  0:31 Revised patch series for minimal HTC Dream support Brian Swetland
2009-06-18  0:31 ` [PATCH 1/3] [ARM] msm_serial: serial driver for MSM7K onboard serial peripheral Brian Swetland
2009-06-18  9:20   ` Alan Cox
2009-06-18 19:29     ` Brian Swetland

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=4A35BD7F.3020803@bluewatersys.com \
    --to=ryan@bluewatersys.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rlove@google.com \
    --cc=swetland@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.