Skip to content

Commit

Permalink
virtio-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: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Wei Yongjun authored and Rusty Russell committed Dec 18, 2012
1 parent 681f206 commit 1ce6853
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions drivers/virtio/virtio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,16 +830,4 @@ static struct pci_driver virtio_pci_driver = {
#endif
};

static int __init virtio_pci_init(void)
{
return pci_register_driver(&virtio_pci_driver);
}

module_init(virtio_pci_init);

static void __exit virtio_pci_exit(void)
{
pci_unregister_driver(&virtio_pci_driver);
}

module_exit(virtio_pci_exit);
module_pci_driver(virtio_pci_driver);

0 comments on commit 1ce6853

Please sign in to comment.