From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Richard Cochran <richardcochran@gmail.com>
Subject: [PATCH v1 net-next 4/7] ptp_pch: Switch to use module_pci_driver() macro
Date: Fri, 13 Aug 2021 15:29:29 +0300 [thread overview]
Message-ID: <20210813122932.46152-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20210813122932.46152-1-andriy.shevchenko@linux.intel.com>
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@linux.intel.com>
---
drivers/ptp/ptp_pch.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index e7e31d4357e7..f3aafe45e1a6 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -10,7 +10,6 @@
#include <linux/device.h>
#include <linux/err.h>
-#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/io-64-nonatomic-lo-hi.h>
@@ -602,24 +601,7 @@ static struct pci_driver pch_driver = {
.remove = pch_remove,
.driver.pm = &pch_pm_ops,
};
-
-static void __exit ptp_pch_exit(void)
-{
- pci_unregister_driver(&pch_driver);
-}
-
-static s32 __init ptp_pch_init(void)
-{
- s32 ret;
-
- /* register the driver with the pci core */
- ret = pci_register_driver(&pch_driver);
-
- return ret;
-}
-
-module_init(ptp_pch_init);
-module_exit(ptp_pch_exit);
+module_pci_driver(pch_driver);
module_param_string(station,
pch_param.station, sizeof(pch_param.station), 0444);
--
2.30.2
next prev parent reply other threads:[~2021-08-13 12:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 12:29 [PATCH v1 net-next 1/7] ptp_pch: use mac_pton() Andy Shevchenko
2021-08-13 12:29 ` [PATCH v1 net-next 2/7] ptp_pch: Use ioread64_lo_hi() / iowrite64_lo_hi() Andy Shevchenko
2021-08-17 16:54 ` kernel test robot
2021-08-17 16:54 ` kernel test robot
2021-08-13 12:29 ` [PATCH v1 net-next 3/7] ptp_pch: Use ioread64_hi_lo() / iowrite64_hi_lo() Andy Shevchenko
2021-08-13 12:29 ` Andy Shevchenko [this message]
2021-08-13 14:34 ` [PATCH v1 net-next 4/7] ptp_pch: Switch to use module_pci_driver() macro kernel test robot
2021-08-13 14:34 ` kernel test robot
2021-08-13 15:13 ` Andy Shevchenko
2021-08-13 15:13 ` Andy Shevchenko
2021-08-13 15:39 ` Andy Shevchenko
2021-08-13 15:39 ` Andy Shevchenko
2021-08-13 18:23 ` Jakub Kicinski
2021-08-13 18:23 ` Jakub Kicinski
2021-08-13 19:26 ` Andy Shevchenko
2021-08-13 19:26 ` Andy Shevchenko
2021-08-13 19:38 ` Andy Shevchenko
2021-08-13 19:38 ` Andy Shevchenko
2021-08-23 8:29 ` Andy Shevchenko
2021-08-23 8:29 ` Andy Shevchenko
2021-08-13 16:19 ` kernel test robot
2021-08-13 16:19 ` kernel test robot
2021-08-13 12:29 ` [PATCH v1 net-next 5/7] ptp_pch: Convert to use managed functions pcim_* and devm_* Andy Shevchenko
2021-08-13 12:29 ` [PATCH v1 net-next 6/7] ptp_pch: Remove unused pch_pm_ops Andy Shevchenko
2021-08-13 12:29 ` [PATCH v1 net-next 7/7] ptp_pch: Load module automatically if ID matches Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210813122932.46152-4-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.