Re: [PATCH net-next v3 03/17] net: ibm: emac: use module_platform_driver for modules
From: Jakub Kicinski
Date: Fri Oct 04 2024 - 19:32:27 EST
On Wed, 2 Oct 2024 19:11:21 -0700 Rosen Penev wrote:
> These init and exit functions don't do anything special. Just macro it
> away.
>
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> drivers/net/ethernet/ibm/emac/mal.c | 10 +---------
> drivers/net/ethernet/ibm/emac/rgmii.c | 10 +---------
> drivers/net/ethernet/ibm/emac/tah.c | 10 +---------
> drivers/net/ethernet/ibm/emac/zmii.c | 10 +---------
> 4 files changed, 4 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
> index d92dd9c83031..a632d3a207d3 100644
> --- a/drivers/net/ethernet/ibm/emac/mal.c
> +++ b/drivers/net/ethernet/ibm/emac/mal.c
> @@ -779,12 +779,4 @@ static struct platform_driver mal_of_driver = {
> .remove_new = mal_remove,
> };
>
> -int __init mal_init(void)
> -{
> - return platform_driver_register(&mal_of_driver);
> -}
> -
> -void mal_exit(void)
> -{
> - platform_driver_unregister(&mal_of_driver);
> -}
> +module_platform_driver(mal_of_driver);
This is not 1:1, right? We're now implicitly adding module_init()
module_exit() annotations which weren't there before. Needs to be
at least mentioned in the commit msg.