Re: [PATCH v3 8/9] firmware: arm_scmi: Add scmi_driver optional setup/teardown callbacks

From: Sudeep Holla
Date: Fri Jul 01 2022 - 10:09:54 EST


On Mon, Jun 27, 2022 at 01:30:37PM +0100, Cristian Marussi wrote:
> Add optional .setup and .teardown methods to the scmi_driver descriptor:
> such callbacks, if provided, will be called by the SCIM core at driver
> registration time, so that, an SCMI driver, registered as usual with the
> module_scmi_driver() helper macro, can provide custom callbacks to be
> run once for all at module load/unload time to perform specific setup
> or teardown operations before/after .probe and .remove steps.
>

What can't the driver call this setup/teardown on its own before/after
calling scmi_driver_register/unregister ?

Based on the usage in 9/9, I guess it is mainly to use the
module_scmi_driver ? If so, I would avoid using that or have another
macro to manage this setup/teardown(once there are multiple users for that).
IMO, it doesn't make sense to add callbacks to do things that are outside
the scope of scmi drivers. No ?

--
Regards,
Sudeep