public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bus_id collisions
@ 2006-11-21  4:02 Benjamin Herrenschmidt
  2006-11-21  6:13 ` David Miller
  2006-11-21  6:41 ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2006-11-21  4:02 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel list

Hi Greg !

It occurs to me (after some trouble I had with custom bus types) that
this comment is incorrect in device.h, in the definition of struct
device :

        char    bus_id[BUS_ID_SIZE];    /* position on parent bus */

As the bus_id needs to be unique for a given bus_type, not only under a
given parent, due to the symlinks in /sys/bus/<bus_type>/.

This has caused me some trouble with of_platform devices, which are
sort-of platform devices but linked to the Open Firmware device-tree, as
I generate their names based on the nodes in the tree which need not be
unique as long as they are unique under a given parent.

I've worked around it, but I though the comment might need to be
clarified.

Also, I don't suppose you have any plan to move away from the bus_id
being a fixed size array inside struct device ? I would very much like
to be able to have larger names ... Among others, in order to handle the
above problem, I tend to include the fully translated 64 bits address of
the device in the name :-) (Hopefully, it's generally smaller and I
don't have leading zero's but still, I have little room left for the
device name which is annoying).

Cheers,
Ben.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-22  4:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-21  4:02 bus_id collisions Benjamin Herrenschmidt
2006-11-21  6:13 ` David Miller
2006-11-21  6:23   ` Benjamin Herrenschmidt
2006-11-21  6:41 ` Greg KH
2006-11-21  6:49   ` Benjamin Herrenschmidt
2006-11-22  4:38     ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox