linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Grant Likely <glikely@gmail.com>
Cc: Kumar Gala <galak@gate.crashing.org>,
	linuxppc-embedded list <linuxppc-embedded@ozlabs.org>
Subject: Re: Platform device model drawback
Date: Fri, 18 Nov 2005 15:47:11 -0800	[thread overview]
Message-ID: <20051118234711.GB26118@kroah.com> (raw)
In-Reply-To: <528646bc0511171546s4095b3ebgb71cd13880480d1b@mail.gmail.com>

On Thu, Nov 17, 2005 at 04:46:17PM -0700, Grant Likely wrote:
> On 11/15/05, Greg KH <greg@kroah.com> wrote:
> > On Tue, Nov 15, 2005 at 01:34:47PM -0600, Kumar Gala wrote:
> > > This is where the confusion is.  We have two instances of device A.  We
> > > want instance 1 of device A bound to driver "enet" and instance 2 of
> > > device A bound to "serial".
> >
> > That's different from what was described earlier :)
> >
> > In this case, you need two different struct devices.
> Which is what we have.
> 
> >
> > > Today both instances are called "deviceA".  However we can't register two
> > > different drivers as "deviceA".
> >
> > Nor would you want to.
> >
> > > Not sure if that clarifies the issue any.
> >
> > A bit.  I think it still sounds messy...
> Does this help?  (We also discussed this a bit at the PPC BoF at OLS this year)
> 
>  For example on the mpc52xx (see arch/ppc/syslib/mpc52xx_devices.c);
>    - 6 PSC devices on chip;
>    - (struct platform_device) for each device has: .name='mpc52xx-psc';
>    - However, SCC1 may be driven by the Ethernet driver but PSC2 and
> PSC6 may be serial
>    - problem then is: How do you get only PSC1 bound to the
> psc-ethernet driver and only PSC2 & PSC6 bound to the serial driver?

I really do not know, sorry.

> 
> Possible solution;  Modify the naming scheme slightly from what is
> currently used.
> 1. Make the Ethernet driver register the name "mpc52xx-psc:eth"
> 2. Make the serial driver register the name "mpc52xx-psc:uart"
> 3. In the board-specific platform code, modify the .name field in
> struct platform_device *before* the device is registered with the
> platform device. (possibly by extending ppc_sys_device_fixup callback)
>    - The board specific code would set PSC1 to "mpc52xx-psc:eth",
> PSC2&6 to "mpc52xx-psc:uart".  PSC3-5 would stick with "mpc52xx-psc"
> and so would not get bound to anything.
> 
> Q: Can the .name field be modified *after* platform_device is
> registered w/ the platform bus?

No, it can not, sorry.

Good luck,

greg k-h

  reply	other threads:[~2005-11-19  0:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-15 16:51 Platform device model drawback Vitaly Bordug
2005-11-15 16:55 ` Greg KH
2005-11-15 17:59   ` Vitaly Bordug
2005-11-15 17:59     ` Greg KH
2005-11-15 19:34       ` Kumar Gala
2005-11-15 22:40         ` Greg KH
     [not found]           ` <50e923300511161839g12ad1e88je46f989192cd3f58@mail.google.com>
     [not found]             ` <20051117041645.GA19145@kroah.com>
2005-11-17 17:51               ` Peter Hanson
2005-11-17 17:49                 ` Greg KH
2005-11-17 23:05                   ` Peter Hanson
2005-11-17 23:46           ` Grant Likely
2005-11-18 23:47             ` Greg KH [this message]
2005-11-19  2:37               ` Grant Likely
2005-11-15 19:43       ` Andy Fleming
2005-11-15 19:41     ` Andrey Volkov

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=20051118234711.GB26118@kroah.com \
    --to=greg@kroah.com \
    --cc=galak@gate.crashing.org \
    --cc=glikely@gmail.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).