diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-10-12 07:19:47 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-10-15 11:23:12 -0400 |
commit | 51c58f2b4f24214950d3dc6ab31af7c2532b096f (patch) | |
tree | c7562e768e03b0f0bdd8daed0ab6a2b1313ff9ae | |
parent | 20903169fed97e1a972a85ed0b02f20465ae2ff8 (diff) |
intel_scu_ipc: Switch to use module_pci_driver() macro
Eliminate some boilerplate code by using module_pci_driver() instead of
init/exit, moving the salient bits from init into probe.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r-- | drivers/platform/x86/intel_scu_ipc.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 5087485a1fa7..9de2029aa909 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
@@ -567,10 +567,15 @@ static irqreturn_t ioc(int irq, void *dev_id) | |||
567 | */ | 567 | */ |
568 | static int ipc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 568 | static int ipc_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
569 | { | 569 | { |
570 | int platform; /* Platform type */ | ||
570 | int err; | 571 | int err; |
571 | struct intel_scu_ipc_dev *scu = &ipcdev; | 572 | struct intel_scu_ipc_dev *scu = &ipcdev; |
572 | struct intel_scu_ipc_pdata_t *pdata; | 573 | struct intel_scu_ipc_pdata_t *pdata; |
573 | 574 | ||
575 | platform = intel_mid_identify_cpu(); | ||
576 | if (platform == 0) | ||
577 | return -ENODEV; | ||
578 | |||
574 | if (scu->dev) /* We support only one SCU */ | 579 | if (scu->dev) /* We support only one SCU */ |
575 | return -EBUSY; | 580 | return -EBUSY; |
576 | 581 | ||
@@ -651,24 +656,8 @@ static struct pci_driver ipc_driver = { | |||
651 | .remove = ipc_remove, | 656 | .remove = ipc_remove, |
652 | }; | 657 | }; |
653 | 658 | ||
654 | static int __init intel_scu_ipc_init(void) | 659 | module_pci_driver(ipc_driver); |
655 | { | ||
656 | int platform; /* Platform type */ | ||
657 | |||
658 | platform = intel_mid_identify_cpu(); | ||
659 | if (platform == 0) | ||
660 | return -ENODEV; | ||
661 | return pci_register_driver(&ipc_driver); | ||
662 | } | ||
663 | |||
664 | static void __exit intel_scu_ipc_exit(void) | ||
665 | { | ||
666 | pci_unregister_driver(&ipc_driver); | ||
667 | } | ||
668 | 660 | ||
669 | MODULE_AUTHOR("Sreedhara DS <sreedhara.ds@intel.com>"); | 661 | MODULE_AUTHOR("Sreedhara DS <sreedhara.ds@intel.com>"); |
670 | MODULE_DESCRIPTION("Intel SCU IPC driver"); | 662 | MODULE_DESCRIPTION("Intel SCU IPC driver"); |
671 | MODULE_LICENSE("GPL"); | 663 | MODULE_LICENSE("GPL"); |
672 | |||
673 | module_init(intel_scu_ipc_init); | ||
674 | module_exit(intel_scu_ipc_exit); | ||