Skip to content

Commit

Permalink
serial: 8250_pci: use module_pci_driver to simplify the code
Browse files Browse the repository at this point in the history
Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Oct 30, 2012
1 parent 669fef4 commit 15a12e8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/tty/serial/8250/8250_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -4332,18 +4332,7 @@ static struct pci_driver serial_pci_driver = {
.err_handler = &serial8250_err_handler,
};

static int __init serial8250_pci_init(void)
{
return pci_register_driver(&serial_pci_driver);
}

static void __exit serial8250_pci_exit(void)
{
pci_unregister_driver(&serial_pci_driver);
}

module_init(serial8250_pci_init);
module_exit(serial8250_pci_exit);
module_pci_driver(serial_pci_driver);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
Expand Down

0 comments on commit 15a12e8

Please sign in to comment.