Re: device/kobject naming

From: Hollis Blanchard
Date: Thu Feb 26 2004 - 16:35:22 EST


On Feb 25, 2004, at 6:18 PM, Greg KH wrote:

No, I think you are confused. The only thing that has to be unique in
the kobject/device name is it must be unique for the bus it is on.

I must be confused. device_initialize() sets the new device->kobj->kset to devices_subsys.kset. Then device_add() calls kobject_add(), which appends device->kobj to its kset. As we've already discussed, devices_subsys is a global list of all registered devices in the system, not a per-bus list.

It doesn't look like this will actually cause an immediate error (in that the sysfs directory created will be different per bus), but you could end up with two devices named "foo" in the devices_subsys list, even if they're on different busses.

--
Hollis Blanchard
IBM Linux Technology Center

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/