Skip to content

Commit

Permalink
mfd: timberdale: Use module_pci_driver
Browse files Browse the repository at this point in the history
module_pci_driver removes some boilerplate and makes the code
simple.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Sachin Kamat authored and Lee Jones committed Sep 2, 2013
1 parent 6243626 commit 0afb00e
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions drivers/mfd/timberdale.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,34 +868,7 @@ static struct pci_driver timberdale_pci_driver = {
.remove = timb_remove,
};

static int __init timberdale_init(void)
{
int err;

err = pci_register_driver(&timberdale_pci_driver);
if (err < 0) {
printk(KERN_ERR
"Failed to register PCI driver for %s device.\n",
timberdale_pci_driver.name);
return -ENODEV;
}

printk(KERN_INFO "Driver for %s has been successfully registered.\n",
timberdale_pci_driver.name);

return 0;
}

static void __exit timberdale_exit(void)
{
pci_unregister_driver(&timberdale_pci_driver);

printk(KERN_INFO "Driver for %s has been successfully unregistered.\n",
timberdale_pci_driver.name);
}

module_init(timberdale_init);
module_exit(timberdale_exit);
module_pci_driver(timberdale_pci_driver);

MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
MODULE_VERSION(DRV_VERSION);
Expand Down

0 comments on commit 0afb00e

Please sign in to comment.