[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210407150704.359424-1-weiyongjun1@huawei.com>
Date: Wed, 7 Apr 2021 15:07:04 +0000
From: Wei Yongjun <weiyongjun1@...wei.com>
To: <weiyongjun1@...wei.com>, Jakub Kicinski <kuba@...nel.org>,
Jason Yan <yanaijie@...wei.com>,
dingsenjie <dingsenjie@...ong.com>,
Chuhong Yuan <hslester96@...il.com>
CC: <netdev@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: [PATCH net-next] net: encx24j600: use module_spi_driver to simplify the code
module_spi_driver() makes the code simpler by eliminating
boilerplate code.
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
.../net/ethernet/microchip/encx24j600.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
index a66a179236fd..3658c4ae3c37 100644
--- a/drivers/net/ethernet/microchip/encx24j600.c
+++ b/drivers/net/ethernet/microchip/encx24j600.c
@@ -1117,17 +1117,7 @@ static struct spi_driver encx24j600_spi_net_driver = {
.id_table = encx24j600_spi_id_table,
};
-static int __init encx24j600_init(void)
-{
- return spi_register_driver(&encx24j600_spi_net_driver);
-}
-module_init(encx24j600_init);
-
-static void encx24j600_exit(void)
-{
- spi_unregister_driver(&encx24j600_spi_net_driver);
-}
-module_exit(encx24j600_exit);
+module_spi_driver(encx24j600_spi_net_driver);
MODULE_DESCRIPTION(DRV_NAME " ethernet driver");
MODULE_AUTHOR("Jon Ringle <jringle@...dpoint.com>");
Powered by blists - more mailing lists