From patchwork Fri Apr 15 00:45:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 65869 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp901620qge; Thu, 14 Apr 2016 17:45:58 -0700 (PDT) X-Received: by 10.37.215.208 with SMTP id o199mr10300792ybg.85.1460681158869; Thu, 14 Apr 2016 17:45:58 -0700 (PDT) Return-Path: Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com. [2607:f8b0:4002:c05::22a]) by mx.google.com with ESMTPS id 7si9797842ybr.156.2016.04.14.17.45.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 17:45:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ashwin.chaugule@linaro.org designates 2607:f8b0:4002:c05::22a as permitted sender) client-ip=2607:f8b0:4002:c05::22a; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ashwin.chaugule@linaro.org designates 2607:f8b0:4002:c05::22a as permitted sender) smtp.mailfrom=ashwin.chaugule@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-yw0-x22a.google.com with SMTP id i84so121842237ywc.2 for ; Thu, 14 Apr 2016 17:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0m+DP8ZC/VYia8b5Ga8HyfOjIvRgmzzeZlJLPKK69/U=; b=jJNMYC1MCloMumsOoRK5miA/OWtzRsqufbADI6KLME34Oqm3OrFnqG4MZFZcPPBXR2 noaR8j6sT3x/rTFq082JCpqBynYebr4JJ5sdAmmcK9xCoRBqVUJnbjMaH/lmEY+8aLiH kgRrsx13b0fFgFgjvntWznGHfQX8fz2XEiQDE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0m+DP8ZC/VYia8b5Ga8HyfOjIvRgmzzeZlJLPKK69/U=; b=b2LbCgCfj1Bv+aTkqqrznYZ0Q9WLVSa4a3CxZ7LmItm279qnOWHukXPbxVG2usB6j0 pQMGqQ8el1mGY2eYil2L/jH/j2En15ykHmitN2NDRvlpIypADaJfSwsc24sES/AgMbXt ozwi2ssfwLActhEXdN7eKveIr4zXEpiawyWnrmdEye8XaONXuMwSs7GfMAtCg1uJmptb hpmAAXqOl8xBN0+ifiW6z17kbL1WCncTTHnmsh63KagTDSf/IrCO6DB/vPOTeXWOddAX xcW5lBUvJixEaYXcbUdycC3uF2MNwM3q0caxSNlcy43N2jfU7wp0Rx32TzB0yP4QdyVm /hug== X-Gm-Message-State: AOPr4FW8fveXfHMBuuRed36wCOb5F/CYHcDYyPCXW5EeMljcuXqegq7bnq1izCg/BMENZ4ivDtg= X-Received: by 10.129.82.145 with SMTP id g139mr11495570ywb.153.1460681158637; Thu, 14 Apr 2016 17:45:58 -0700 (PDT) Return-Path: Received: from esagroth.lan ([98.122.160.202]) by smtp.gmail.com with ESMTPSA id i67sm25375197ywf.34.2016.04.14.17.45.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Apr 2016 17:45:57 -0700 (PDT) From: Ashwin Chaugule To: rjw@rjwysocki.net Cc: srinivas.pandruvada@intel.com, linux-pm@vger.kernel.org, linaro-acpi@lists.linaro.org, patches@linaro.org, Ashwin Chaugule Subject: [PATCH] ACPI / CPPC: Add module support for cppc_cpufreq driver Date: Thu, 14 Apr 2016 20:45:53 -0400 Message-Id: <1460681153-14671-1-git-send-email-ashwin.chaugule@linaro.org> X-Mailer: git-send-email 1.9.1 Add a function to cleanup at module exit and export appropriate GPL string to enable moduler support for the cppc_cpufreq driver. Reported-by: Srinivas Pandruvada Signed-off-by: Ashwin Chaugule --- drivers/cpufreq/cppc_cpufreq.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -- 1.9.1 diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 7c0bdfb..8882b8e 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -173,4 +173,25 @@ out: return -ENODEV; } +static void __exit cppc_cpufreq_exit(void) +{ + struct cpudata *cpu; + int i; + + cpufreq_unregister_driver(&cppc_cpufreq_driver); + + for_each_possible_cpu(i) { + cpu = all_cpu_data[i]; + free_cpumask_var(cpu->shared_cpu_map); + kfree(cpu); + } + + kfree(all_cpu_data); +} + +module_exit(cppc_cpufreq_exit); +MODULE_AUTHOR("Ashwin Chaugule"); +MODULE_DESCRIPTION("CPUFreq driver based on the ACPI CPPC v5.0+ spec"); +MODULE_LICENSE("GPL"); + late_initcall(cppc_cpufreq_init);