Skip to content

Commit

Permalink
ptp_pch: Switch to use module_pci_driver() macro
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Richard Cochran <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
andy-shev authored and kuba-moo committed Feb 9, 2022
1 parent d09adf6 commit 3fa66d3
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions drivers/ptp/ptp_pch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -603,24 +602,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);
Expand Down

0 comments on commit 3fa66d3

Please sign in to comment.