That's fine if you want to add it to the parent. If so, then the
kobject controls the lifetime of the structure, nothing else can.
The problem was parent object(i.e., struct cma cma_areas) is
static arrary so kobj->release function will be NULL or just
dummy. Is it okay? I thought it was one of the what you wanted
to avoid it.
No, that is not ok.
Either is fine with me, what is "forbidden" is having a kobject and
somehow thinking that it does not control the lifetime of the structure.
Since parent object is static arrary, there is no need to control the
lifetime so I am curious if parent object approach is okay from kobject
handling point of view.
So the array is _NEVER_ freed? If not, fine, don't provide a release
function for the kobject, but ick, just make a dynamic kobject I don't
see the problem for something so tiny and not very many...
I worry that any static kobject might be copied/pasted as someone might
think this is an ok thing to do. And it's not an ok thing to do.