Thread (11 messages) 11 messages, 6 authors, 2005-11-19

Re: Platform device model drawback

flat view

From: Greg KH <hidden>
Date: 2005-11-15 19:27:12

On Tue, Nov 15, 2005 at 08:59:06PM +0300, Vitaly Bordug wrote:
Greg KH wrote:
quoted
On Tue, Nov 15, 2005 at 07:51:20PM +0300, Vitaly Bordug wrote:
quoted
Hi, Greg!

While doing "platformization" for one of the Freescale SoC's, I have 
discovered a serious drawback of the model - it prevents registering 
driver with the same name.
That's not a "drawback" :)
quoted
For instance, cpm2 on either ppc82xx or ppc85xx is very flexible, and 
its device fsl-cpm-scc could (and actually are) utilized in the 
different drivers.

Those devices will have different bus_id, but pdev->name fields are the 
same for all the fsl-cpm-scc, only id is different there. Hence the 
fsl-cpm-scc could be driver_register'ed only once, while it is required 
several times.
A driver is registered only once, but can be bound to multiple devices
just fine, right?
Please let me know, how?
All PCI and USB and I2C drivers are able to bind to multiple devices :)
I have for instance struct device_driver with name="fsl-cpm-scc" in both 
fs_enet and cpm_uart(one using SCC1, the other - SCC4, the same device with 
different id's).

Once it has been registered in fs_enet, I could not register it in 
cpm_uart, due to kobject_register fo require unique names in kobject->name. 
Am I missing something?
You only register the driver once.  The individual devices can be bound
to the same driver, right?
Not registering it in CPM_UART, how the pdev could be obtained?

Maybe this is clear, but platform stuff is cumbersome some times...
Then make it cleaner :)

If you have specific code that explains this better, that might help
out.

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help