On Tue, Apr 28, 2009 at 18:08, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: > Kay Sievers wrote: >> On Tue, Apr 28, 2009 at 17:51, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: >> >>> before device_register==>device_initialize is called, kobj->ref is still 0. >>> >>> will get warn from >>> if (!kobj->state_initialized) >> >> Initialize the device before you do anything with it. And call _put() >> any time to get rid of ressources, which might have been allocated >> before registering. > so you mean don't call dev_set_name before device_register and let device_register or device_add take name param? No. I meant: device_initialize() call put_device() any time you want to get rid of ressources of the device device_set_name() call put_device() any time you want to get rid of ressources of the device device_register() ... Kay -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html