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: 8843991 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5B624C0553 for ; Fri, 15 Apr 2016 00:46:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 843E6202FF for ; Fri, 15 Apr 2016 00:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D8FC20270 for ; Fri, 15 Apr 2016 00:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433AbcDOAp7 (ORCPT ); Thu, 14 Apr 2016 20:45:59 -0400 Received: from mail-yw0-f172.google.com ([209.85.161.172]:34098 "EHLO mail-yw0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802AbcDOAp7 (ORCPT ); Thu, 14 Apr 2016 20:45:59 -0400 Received: by mail-yw0-f172.google.com with SMTP id d68so121885882ywe.1 for ; Thu, 14 Apr 2016 17:45:59 -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=Mc0HV0N+c8avV+pUBYyNO2toHx/I2Rvdzl5vsjNVx5MbKKvJwLRWQbKwl0Q1TzWrmg S5TvTIf/n9xwW53I0NYdXl+DKrjNy+Jjc2wPNnXSUdqwdlvAsOufRcyYXmbr2Y/UHiE8 RkdfxWEYBCNHM3zuqELLsJ4HLeFjrlxLEMhdyaQFAL4Hrm+2e5fe39yd1IgXXzccL/6T FpXRPrRECeKRBt77Fpc1uK1j7cMTeWXcNEuVqCEDM7Jsb4Hekd3qTN6neGtjFS2Z9I3o 06VY3/5p0FpFgAFVbNQJxBUJUddxoIH4WSleQWI+gCQVYwBwDdQlEZnY80PBXRJHCTxz V1dQ== X-Gm-Message-State: AOPr4FX3xuSxOxzNmx9UlrVE39cD2WM4TZRAMODnw1G0yYYepUzwcg+nu7fhl3JkxzXF8u7r X-Received: by 10.129.82.145 with SMTP id g139mr11495570ywb.153.1460681158637; Thu, 14 Apr 2016 17:45:58 -0700 (PDT) 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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);