[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210813122737.45860-1-andriy.shevchenko@linux.intel.com>
Date: Fri, 13 Aug 2021 15:27:35 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Jonathan Lemon <jonathan.lemon@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Richard Cochran <richardcochran@...il.com>
Subject: [PATCH v1 net-next 1/3] ptp_ocp: Switch to use module_pci_driver() macro
Eliminate some boilerplate code by using module_pci_driver() instead of
init/exit, and, if needed, moving the salient bits from init into probe.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/ptp/ptp_ocp.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 0d1034e3ed0f..874ea7930079 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -4,7 +4,6 @@
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/init.h>
#include <linux/pci.h>
#include <linux/ptp_clock_kernel.h>
@@ -377,24 +376,7 @@ static struct pci_driver ptp_ocp_driver = {
.probe = ptp_ocp_probe,
.remove = ptp_ocp_remove,
};
-
-static int __init
-ptp_ocp_init(void)
-{
- int err;
-
- err = pci_register_driver(&ptp_ocp_driver);
- return err;
-}
-
-static void __exit
-ptp_ocp_fini(void)
-{
- pci_unregister_driver(&ptp_ocp_driver);
-}
-
-module_init(ptp_ocp_init);
-module_exit(ptp_ocp_fini);
+module_pci_driver(ptp_ocp_driver);
MODULE_DESCRIPTION("OpenCompute TimeCard driver");
MODULE_LICENSE("GPL v2");
--
2.30.2
Powered by blists - more mailing lists