public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Class device namespaces
@ 2009-03-29 15:48 Jean Delvare
  2009-03-29 16:36 ` Kay Sievers
  0 siblings, 1 reply; 32+ messages in thread
From: Jean Delvare @ 2009-03-29 15:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Kay Sievers, Mauro Carvalho Chehab, Michael E Brown

Hi Greg,

I am a little confused by the directories created when one registers a
class device. When a class device is registered as the children of a
real device, a subdirectory by the class name is created, and the class
device is created there, effectively granting each class a separate
namespace. Example:

/sys/devices/pci0000:00/0000:00:1f.3/i2c-adapter/i2c-0

where 0000:00:1f.3 is the physical device, i2c-adapter the class name
and i2c-0 the class device.

OTOH, if I create a class device as the children of another class
device, the class device is created directly, without a directory
between the parent and the child. Example:

/sys/class/i2c-adapter/i2c-0/i2c-0

where the first i2c-0 is an i2c-adapter class device, and the second
i2c-0 is an i2c-dev class device. I would have expected:

/sys/class/i2c-adapter/i2c-0/i2c-dev/i2c-0

The current behavior seems inconsistent to me. Is it done so on purpose,
or is this accidental? If on purpose, what's the reason?

I am asking because this is causing trouble in practice. We have both
i2c-dev and firmware_class which try to create class devices by the
same name and this of course collides. While I would blame
firmware_class for coming up with an horrible naming scheme (or
actually, for not coming up with any naming scheme) it might still be a
good idea to prevent such collisions at the driver core level.

Thanks,
-- 
Jean Delvare

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

end of thread, other threads:[~2009-04-30 16:34 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-29 15:48 Class device namespaces Jean Delvare
2009-03-29 16:36 ` Kay Sievers
2009-03-30  8:49   ` Jean Delvare
2009-03-30 11:24     ` Kay Sievers
2009-04-26  6:54       ` Jean Delvare
2009-04-26 12:44         ` Matt Domsch
2009-04-26 13:01           ` Matt Domsch
2009-04-27 15:30             ` Jean Delvare
2009-04-27 17:30               ` Matt Domsch
2009-04-26 13:42         ` Kay Sievers
2009-04-27 16:00           ` Jean Delvare
2009-04-27 21:57             ` Kay Sievers
2009-04-28  8:08               ` Jean Delvare
2009-04-28 12:36                 ` Kay Sievers
2009-04-29 12:19                   ` Jean Delvare
2009-04-27 13:20         ` Michael E Brown
2009-04-27 15:27           ` Jean Delvare
2009-04-27 17:23             ` Michael Brown
2009-04-28  8:10               ` Jean Delvare
2009-04-28 17:39                 ` Doug Warzecha
2009-04-28 17:46                   ` Kay Sievers
2009-04-28 21:58                     ` Doug Warzecha
2009-04-29  1:42                       ` Kay Sievers
2009-04-29  3:19                         ` Michael Brown
2009-04-29 10:30                           ` Kay Sievers
2009-04-29 17:00                             ` Michael Brown
2009-04-29 19:10                               ` Kay Sievers
2009-04-29 21:28                                 ` Michael Brown
2009-04-29 21:53                                   ` Kay Sievers
2009-04-30 15:18                                     ` David Dillow
2009-04-30 16:34                                       ` Kay Sievers
2009-04-28 19:06                   ` Jean Delvare

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