All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Gala <kumar.gala@freescale.com>
To: "Russell King" <rmk+lkml@arm.linux.org.uk>
Cc: "Linux Kernel list" <linux-kernel@vger.kernel.org>
Subject: Re: serial8250_init and platform_device
Date: Thu, 20 Jan 2005 09:23:56 -0600	[thread overview]
Message-ID: <4D4277A8-6AF7-11D9-A0BF-000393DBC2E8@freescale.com> (raw)
In-Reply-To: <20050120114328.A3110@flint.arm.linux.org.uk>

I'm trying to convert some PPC embedded code from using the old "ISA 
compat" style with SERIAL_PORT_DFNS to using platform_device.

> 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.

No problem, let me try to clarify.  I'm trying to figure out in the ARM 
case if there are 2 platform_devices that are registered and if this is 
the desired behavior (and if so why?).

> 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.

In serial8250_init() we call platform_device_register_simple(), this 
will be one registration of a serial8250 device.  In my example of 
vr1000, arch/arm/mach-s3c2410/cpu.c:s3c_arch_init() calls 
platform_device_register, the 2nd time a serial8250 device is 
registered.

> 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().

I'm not following you here, its not clear if you mean we have 2 
platform devices registered in the system, but only one actually has 
serial ports that are registered.  If you are using SERIAL_PORT_DFNS, 
it will be the platform_device created in serial8250_init(), if you are 
not it will be the platform_device created elsewhere?

> 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.

- kumar


  reply	other threads:[~2005-01-20 15:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20  7:14 serial8250_init and platform_device Kumar Gala
2005-01-20 11:43 ` Russell King
2005-01-20 15:23   ` Kumar Gala [this message]
2005-01-20 15:44     ` Russell King
2005-01-20 19:06       ` Kumar Gala
2005-01-20 19:38         ` Russell King
2005-01-20 19:50           ` Greg KH
2005-01-20 20:10             ` Russell King
2005-01-20 20:25               ` Kumar Gala
2005-02-01  8:41               ` Greg KH
2005-01-20 20:26           ` Kumar Gala

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=4D4277A8-6AF7-11D9-A0BF-000393DBC2E8@freescale.com \
    --to=kumar.gala@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    /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.