Re: serial8250_init and platform_device

From: Russell King
Date: Thu Jan 20 2005 - 06:45:17 EST


On Thu, Jan 20, 2005 at 01:14:49AM -0600, Kumar Gala wrote:
> I dont get how it is you dont have more platform_devices register than
> you should based on how serial8250_init works if you have additional
> code registering a serial8250 device. For example,
> arch/arm/mach-s3c2410/mach-vr1000.c will register one serial8250
> device, and it appears to me that serial8250_init will register a 2nd.
> Is this the expected behavior or am I missing something?

I don't understand what you're saying, sorry.

serial8250_init() registers an "ISA compatibility" 8250 device for those
architectures which haven't converted themselves to the new scheme.

It then creates all the 8250 ports from 0..UART_NR. In the case of an
architecture which doesn't have any SERIAL_PORT_DFNS defined (eg, ARM)
these are just dummy placeholder registrations.

We then register the device driver, which allows us to pick up on the
platform devices. This causes the placeholder registrations to be
reassigned to the platform devices on a first come first served basis
via the standard registration call serial8250_register_port().

While you can have both the "ISA compatibility" scheme and the
"platform device" scheme contain the same port description, you'll
only end up with just the one port registered in the end. That just
happens to be correct and desired behaviour.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/