[PATCH] Use platform device for 8250 registration

David Woodhouse dwmw2 at infradead.org
Wed Aug 17 17:31:11 EST 2005


On Wed, 2005-08-17 at 01:30 -0500, Kumar Gala wrote:
> > We could probably remove all the rest of the crap from asm/serial.h and
> > let platforms register their own serial8250 platform devices...

> Hmm, I wondering if we can provide some standard way of handling this  
> for the embedded platforms as well.  It would be nice to drop the old  
> style of initialization completely and move to using a platform  
> device always.

Yes, that's precisely what I meant. Just remove it from the list in
serial.h and as Ben says, instantiating a platform device is easy.

static struct plat_serial8250_port my_serial_ports[] = {
	{
		.uartclk = 115200*16,
		.iobase = 0x2f8,
		.irq = 3,
		.flags = ASYNC_BOOT_AUTOCONF;
	},
};

static struct platform_device my_serial_device = {
	.name = "serial8250",
	.dev.platform_data = my_serial_ports,
};

  ... platform_device_register(&my_serial_device);

-- 
dwmw2




More information about the Linuxppc-dev mailing list