Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1244605
| Path | csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 4/5] intel_scu_ipc: switch to use module_pci_driver() macro |
| Date | Mon, 12 Oct 2015 13:30:03 +0200 |
| Message-ID | <qiJsK-5Ti-25@gated-at.bofh.it> (permalink) |
| References | <qiJsK-5Ti-9@gated-at.bofh.it> |
| X-Original-To | platform-driver-x86@vger.kernel.org, Darren Hart <dvhart@infradead.org>, linux-kernel@vger.kernel.org |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.17,672,1437462000"; d="scan'208";a="824657681" |
| X-Mailer | git-send-email 2.5.3 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 62 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
| X-Original-Date | Mon, 12 Oct 2015 14:19:47 +0300 |
| X-Original-Message-ID | <1444648788-74265-5-git-send-email-andriy.shevchenko@linux.intel.com> |
| X-Original-References | <1444648788-74265-1-git-send-email-andriy.shevchenko@linux.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1244605 |
Show key headers only | View raw
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>
---
drivers/platform/x86/intel_scu_ipc.c | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 5087485..9de2029 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)
*/
static int ipc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
+ int platform; /* Platform type */
int err;
struct intel_scu_ipc_dev *scu = &ipcdev;
struct intel_scu_ipc_pdata_t *pdata;
+ platform = intel_mid_identify_cpu();
+ if (platform == 0)
+ return -ENODEV;
+
if (scu->dev) /* We support only one SCU */
return -EBUSY;
@@ -651,24 +656,8 @@ static struct pci_driver ipc_driver = {
.remove = ipc_remove,
};
-static int __init intel_scu_ipc_init(void)
-{
- int platform; /* Platform type */
-
- platform = intel_mid_identify_cpu();
- if (platform == 0)
- return -ENODEV;
- return pci_register_driver(&ipc_driver);
-}
-
-static void __exit intel_scu_ipc_exit(void)
-{
- pci_unregister_driver(&ipc_driver);
-}
+module_pci_driver(ipc_driver);
MODULE_AUTHOR("Sreedhara DS <sreedhara.ds@intel.com>");
MODULE_DESCRIPTION("Intel SCU IPC driver");
MODULE_LICENSE("GPL");
-
-module_init(intel_scu_ipc_init);
-module_exit(intel_scu_ipc_exit);
--
2.5.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/5] intel_scu_ipc: bug fixes and amendments Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-10-12 13:30 +0200 [PATCH v2 2/5] intel_scu_ipc: propagate pointer to struct intel_scu_ipc_dev Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-10-12 13:30 +0200 [PATCH v2 4/5] intel_scu_ipc: switch to use module_pci_driver() macro Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-10-12 13:30 +0200 [PATCH v2 1/5] intel_scu_ipc: fix error path by turning to devm_* / pcim_* Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-10-12 13:30 +0200 [PATCH v2 3/5] intel_scu_ipc: convert to use struct device * Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-10-12 13:30 +0200 Re: [PATCH v2 0/5] intel_scu_ipc: bug fixes and amendments Darren Hart <dvhart@infradead.org> - 2015-10-15 06:50 +0200
csiph-web