Thread (3 messages) 3 messages, 2 authors, 2018-08-10

kobj->state_initialized is never set to 0

From: Helen Koike <hidden>
Date: 2018-07-20 18:33:22

Hi,

I am simulating hotplugging a platform device (to the
media/platform/vimc driver), so I register it using
platform_device_register, then I unregister it with
platform_device_unregister, then I register it again, but the code
doesn't allow me to register something that was registered before due
to this line:

    https://github.com/torvalds/linux/blob/master/lib/kobject.c#L334

The variable kobj->state_initialized is set to 1 at

    https://github.com/torvalds/linux/blob/master/lib/kobject.c#L194

but it is never set to 0 again.

Is this how it is supposed to work? Or kobj->state_initialized is set
to 0 somewhere else I couldn't find?

Thanks
Helen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help