Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2044169imm; Thu, 21 Jun 2018 06:26:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKKubFWMj07UjXS/UD8vwoARJTtFkwHrAudxuBzKGYKxk2ACdvu3Qm7vCUshX9v3gzVy9Hi X-Received: by 2002:a63:b305:: with SMTP id i5-v6mr22714383pgf.370.1529587609002; Thu, 21 Jun 2018 06:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529587608; cv=none; d=google.com; s=arc-20160816; b=bo8pz6l4XsaNB609VEiKJ9hkMYN88MpQERZGVFPJJzA1vgOetpVvCCQg5BlK8DpgRi fpHMHhM080Tmbcq5vPEk1ndeHHP1NOr75EggpD+fCVgKIc25XL2t28rZt3p7do0shwIH vGWSqz+ByTwWnI04A8egpfKpXEQ0z3KR0UvaXP8NWu7TWIR3WoRe2VgtcsdohSP/Km+W XCYf0H3/EI/i4oY6oL95VhKeOoOmPbzlw8Ueyyj5QMen3sc42ls2TAfqAEGQVZLbQrhh MkRQtp0a4JHXbA+t2SUrFBn3/auO3qwikK7aiE/BzevT+8q1Z1R9bQjazAjlPV6tJRH5 2Wsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ZqN58Tp0O2lZdoEB05Q5uPZkWVSq+lM9/kR2V+y0+rU=; b=IgFnQsakdx6Q1inIeD9bMMxQkaghRVdY8NV4a05CjVCXxxaKaOTQUyYMpxpVWBzaa6 OGl27+zs13qsDaOkarbbJmdaV5ugtXrAYMwz0PgOrBbpjx1dkQk5M17fzxx+Y9iwwN+2 CWpNhFPb1ZEgO/+kXNCqYNAKCHTYZ+YwQikZ2tpQh+FC25NXcZv27Y9Zrev8as4bZaCq 0/UNLj/jhMseyEvYYSPwS+62ywwwyHctIhrjQCjx6gJARnKN4hZP1utPhzrcxJ1aS7ln b/xEIC8n0nQBg4R5zMKTrVeBUJX+/0MdOhZmCHlO1MiU364xsV1E0Nu3FlgC805MBejq +cnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10-v6si4853615pls.480.2018.06.21.06.26.35; Thu, 21 Jun 2018 06:26:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933323AbeFUNYZ (ORCPT + 99 others); Thu, 21 Jun 2018 09:24:25 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:44092 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933039AbeFUNYY (ORCPT ); Thu, 21 Jun 2018 09:24:24 -0400 Received: from 79.184.254.22.ipv4.supernova.orange.pl (79.184.254.22) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id cb89fc5d67f88bdd; Thu, 21 Jun 2018 15:24:23 +0200 From: "Rafael J. Wysocki" To: Viresh Kumar , ilia.lin@gmail.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] cpufreq: kryo: Add module remove and exit Date: Thu, 21 Jun 2018 15:23:11 +0200 Message-ID: <2736020.lelA2SSAlr@aspire.rjw.lan> In-Reply-To: <20180618045550.sasilydvnlsmxzpk@vireshk-i7> References: <20180614204212.2028-1-ilia.lin@gmail.com> <20180617200146.16425-1-ilia.lin@gmail.com> <20180618045550.sasilydvnlsmxzpk@vireshk-i7> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, June 18, 2018 6:55:50 AM CEST Viresh Kumar wrote: > On 17-06-18, 22:01, ilia.lin@gmail.com wrote: > > From: Ilia Lin > > > > Add device remove and module exit code to make the driver > > functioning as a loadable module. > > > > Fixes: ac28927659be (cpufreq: kryo: allow building as a loadable module) > > Signed-off-by: Ilia Lin > > --- > > drivers/cpufreq/qcom-cpufreq-kryo.c | 22 +++++++++++++++++++--- > > 1 file changed, 19 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/cpufreq/qcom-cpufreq-kryo.c b/drivers/cpufreq/qcom-cpufreq-kryo.c > > index 74b9b93d511b..01bddacf5c3b 100644 > > --- a/drivers/cpufreq/qcom-cpufreq-kryo.c > > +++ b/drivers/cpufreq/qcom-cpufreq-kryo.c > > @@ -42,6 +42,8 @@ enum _msm8996_version { > > NUM_OF_MSM8996_VERSIONS, > > }; > > > > +struct platform_device *cpufreq_dt_pdev, *kryo_cpufreq_pdev; > > + > > static enum _msm8996_version __init qcom_cpufreq_kryo_get_msm_id(void) > > { > > size_t len; > > @@ -74,7 +76,6 @@ static enum _msm8996_version __init qcom_cpufreq_kryo_get_msm_id(void) > > static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) > > { > > struct opp_table *opp_tables[NR_CPUS] = {0}; > > - struct platform_device *cpufreq_dt_pdev; > > enum _msm8996_version msm8996_version; > > struct nvmem_cell *speedbin_nvmem; > > struct device_node *np; > > @@ -165,8 +166,15 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) > > return ret; > > } > > > > +static int qcom_cpufreq_kryo_remove(struct platform_device *pdev) > > +{ > > + platform_device_unregister(cpufreq_dt_pdev); > > + return 0; > > +} > > + > > static struct platform_driver qcom_cpufreq_kryo_driver = { > > .probe = qcom_cpufreq_kryo_probe, > > + .remove = qcom_cpufreq_kryo_remove, > > .driver = { > > .name = "qcom-cpufreq-kryo", > > }, > > @@ -201,8 +209,9 @@ static int __init qcom_cpufreq_kryo_init(void) > > if (unlikely(ret < 0)) > > return ret; > > > > - ret = PTR_ERR_OR_ZERO(platform_device_register_simple( > > - "qcom-cpufreq-kryo", -1, NULL, 0)); > > + kryo_cpufreq_pdev = platform_device_register_simple( > > + "qcom-cpufreq-kryo", -1, NULL, 0); > > + ret = PTR_ERR_OR_ZERO(kryo_cpufreq_pdev); > > if (0 == ret) > > return 0; > > > > @@ -211,5 +220,12 @@ static int __init qcom_cpufreq_kryo_init(void) > > } > > module_init(qcom_cpufreq_kryo_init); > > > > +static void __init qcom_cpufreq_kryo_exit(void) > > +{ > > + platform_device_unregister(kryo_cpufreq_pdev); > > + platform_driver_unregister(&qcom_cpufreq_kryo_driver); > > +} > > +module_exit(qcom_cpufreq_kryo_exit); > > + > > MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Kryo CPUfreq driver"); > > MODULE_LICENSE("GPL v2"); > > Acked-by: Viresh Kumar Patch applied, thanks!