Re: [PATCH 0/4] driver: core: add subsys_platform_driver() to reduce boilerplate code in drivers

From: Pankaj Patil

Date: Wed Sep 09 2026 - 12:45:59 EST


On 9/8/2026 11:17 PM, Brian Masney wrote:
> There are a fair number of clk drivers that are registered at the
> subsys_initcall level since some clk drivers need to be initialized
> early for other drivers. Let's add a new macro
> subsys_platform_driver() similar module_platform_driver() to eliminate
> some boilerplate code in the drivers.
>
> This series converts the Qualcomm and Renesas clk drivers to show the
> code savings that can be achieved. Once this lands, I'll convert the
> remaining clk drivers this development cycle if all of this can go
> through the clk tree.
>
> Outside of drivers/clk, there are 364 drivers that use subsys_initcall
> and I am willing to convert those as well starting the next development
> cycle once this lands in Linus's tree.
>
> Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>
> ---
> Brian Masney (4):
> driver: core: add subsys_driver() macro
> driver: core: platform: add subsys_platform_driver() macro
> clk: qcom: convert drivers over to use subsys_platform_driver()
> clk: renesas: convert drivers over to use subsys_platform_driver()
>
> drivers/clk/qcom/dispcc-x1e80100.c | 12 +-----------
> drivers/clk/qcom/gcc-eliza.c | 12 +-----------
> drivers/clk/qcom/gcc-glymur.c | 12 +-----------

Tested on Glymur-CRD
Tested-by: Pankaj Patil <pankaj.patil@xxxxxxxxxxxxxxxx>

[...]
> drivers/clk/renesas/rzg2l-cpg.c | 7 +------
> drivers/clk/renesas/rzv2h-cpg.c | 7 +------
> include/linux/device/driver.h | 31 +++++++++++++++++++++++++++++++
> include/linux/platform_device.h | 30 ++++++++++++++++++++++++++++++
> 48 files changed, 107 insertions(+), 487 deletions(-)
> ---
> base-commit: 944a035ecca915ae947905dcfb03f2b9dc6d032c
> change-id: 20260908-subsys_initcall-05dfd5fb0f04
>
> Best regards,
> --
> Brian Masney <bmasney@xxxxxxxxxx>
>
>