From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from perch.kroah.org (mail.kroah.org [69.55.234.183]) by ozlabs.org (Postfix) with ESMTP id 0443968775 for ; Sat, 19 Nov 2005 11:02:59 +1100 (EST) Date: Fri, 18 Nov 2005 15:47:11 -0800 From: Greg KH To: Grant Likely Message-ID: <20051118234711.GB26118@kroah.com> References: <20051115175955.GA14518@kroah.com> <20051115224056.GA14357@kroah.com> <528646bc0511171546s4095b3ebgb71cd13880480d1b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <528646bc0511171546s4095b3ebgb71cd13880480d1b@mail.gmail.com> Cc: Kumar Gala , linuxppc-embedded list Subject: Re: Platform device model drawback List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, Nov 17, 2005 at 04:46:17PM -0700, Grant Likely wrote: > On 11/15/05, Greg KH 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