Re: register_device: was: Re: [PATCH v6 06/11] printk: console: Introduce sysfs interface for per-console loglevels

From: Chris Down
Date: Thu Nov 14 2024 - 13:41:53 EST


Petr Mladek writes:
Honestly, I am not sure how to review this. I am not familiar with
these APIs. I have spent few hours trying to investigate various
drivers but I did not find any similar use case. I tried to look
for documentation but I did not find any good HOWTO.

It seems to work but it is the only thing that I could
say about it ;-)

Just by chance, do you have any pointers into a code or
documentation which could help me to feel more comfortable?

I think you and I are in a similar boat :-) Some similar code can be seen in places like block/genhd.c in device_add_disk and __alloc_disk_node, which also do this kind of dynamic setup. I mostly just spent my time looking at device.h and its users.

Greg, maybe you could also take a look?