[PATCH 7/7] Add MPC512x PSC serial driver

Stephen Rothwell sfr at canb.auug.org.au
Wed Jan 9 14:16:49 EST 2008


On Tue,  8 Jan 2008 09:01:33 -0700 John Rigby <jrigby at freescale.com> wrote:
>
> +++ b/drivers/serial/mpc512x_uart.c
>
> +#include <asm/of_platform.h>

Purely to avoid suggestions of favouritism, I will not the above. :-)

> +static struct of_device_id mpc512x_uart_of_match[] = {

Please make this const.

> +static void mpc512x_uart_of_enumerate(void)
> +{

> +	for_each_node_by_type(np, "serial") {
> +		if (!of_match_node(mpc512x_uart_of_match, np))
> +			continue;
> +
> +		/* Is a particular device number requested? */
> +		devno = of_get_property(np, "port-number", NULL);
> +		mpc512x_uart_of_assign(of_node_get(np), devno ? *devno : -1);

This of_node_get() should be in mpc512x_uart_of_assign() where the
reference is kept.

> +static struct of_platform_driver mpc512x_uart_of_driver = {
> +	.owner = THIS_MODULE,
> +	.name = "mpc52xx-psc-uart",

You don't need these two (we are removing them) but move the .owner
assignment to the .driver part below.

> +	.match_table = mpc512x_uart_of_match,
> +	.probe = mpc512x_uart_of_probe,
> +	.remove = mpc512x_uart_of_remove,
> +#ifdef CONFIG_PM
> +	.suspend = mpc512x_uart_of_suspend,
> +	.resume = mpc512x_uart_of_resume,
> +#endif
> +	.driver = {
> +		   .name = "mpc52xx-psc-uart",
> +		   },
> +};

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080109/a262c2e2/attachment.pgp>


More information about the Linuxppc-dev mailing list