Re: [PATCH v2 1/8] driver core: add helper macro for module_faux_driver() boilerplate
From: Greg Kroah-Hartman
Date: Tue Apr 15 2025 - 08:23:30 EST
On Tue, Mar 18, 2025 at 05:01:39PM +0000, Sudeep Holla wrote:
> For simple modules that needs to create a faux device without any
> additional setup code ends up being a block of duplicated boilerplate.
>
> Add a new macro, module_faux_driver(), which help to replaces the
> those duplicated boilerplate.
>
> This macro use the same idea of module_platform_driver() but adds this
> initial condition to avoid creation of faux device if not necessary.
What is this "condition" for?
Every time you put "true" or "false" in the function call, someone will
have to look it up to see what is going on, that's going to be a pain.
Making apis is hard, let's not making using them even harder.
thanks,
greg k-h