Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933825AbeAKLQM (ORCPT + 1 other); Thu, 11 Jan 2018 06:16:12 -0500 Received: from mga11.intel.com ([192.55.52.93]:55454 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933762AbeAKLQK (ORCPT ); Thu, 11 Jan 2018 06:16:10 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,344,1511856000"; d="scan'208";a="9580786" From: Rajneesh Bhardwaj To: platform-driver-x86@vger.kernel.org Cc: dvhart@infradead.org, andy@infradead.org, linux-kernel@vger.kernel.org, vishwanath.somayaji@intel.com, srinivas.pandruvada@linux.intel.com, Rajneesh Bhardwaj Subject: [PATCH v1 4/6] platform/x86: intel_pmc_core: Change driver to a module Date: Thu, 11 Jan 2018 16:40:34 +0530 Message-Id: <1515669036-3465-5-git-send-email-rajneesh.bhardwaj@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515669036-3465-1-git-send-email-rajneesh.bhardwaj@intel.com> References: <1515669036-3465-1-git-send-email-rajneesh.bhardwaj@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Srinivas Pandruvada Allow the driver to be a module since builtin_pci_driver funtionality is no longer needed. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rajneesh Bhardwaj --- drivers/platform/x86/Kconfig | 2 +- drivers/platform/x86/intel_pmc_core.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 2c745e8ccad6..683a875f3b6c 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -949,7 +949,7 @@ config INTEL_IMR If you are running on a Galileo/Quark say Y here. config INTEL_PMC_CORE - bool "Intel PMC Core driver" + tristate "Intel PMC Core driver" depends on PCI ---help--- The Intel Platform Controller Hub for Intel Core SoCs provides access diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index 00748472a55e..44353034718a 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include #include #include @@ -124,6 +124,7 @@ static const struct pci_device_id pmc_pci_ids[] = { (kernel_ulong_t)&spt_reg_map }, { 0, }, }; +MODULE_DEVICE_TABLE(pci, pmc_pci_ids); static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset) { @@ -520,10 +521,20 @@ static int pmc_core_probe(struct pci_dev *dev, const struct pci_device_id *id) return 0; } +static void pmc_core_remove(struct pci_dev *dev) +{ + pmc_core_dbgfs_unregister(&pmc); + mutex_destroy(&pmc.lock); +} + static struct pci_driver intel_pmc_core_driver = { .name = "intel_pmc_core", .id_table = pmc_pci_ids, .probe = pmc_core_probe, + .remove = pmc_core_remove, }; -builtin_pci_driver(intel_pmc_core_driver); +module_pci_driver(intel_pmc_core_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Intel PMC Core Driver"); -- 2.7.4