Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp260396imm; Thu, 14 Jun 2018 19:46:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKUdtErlAxAxTTwMa3OkezzOlYUCZGMlZeZTSH1a8pBb43UukDWm1q9K26r9mUopYYq7lrl X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr5766881plb.274.1529030784507; Thu, 14 Jun 2018 19:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529030784; cv=none; d=google.com; s=arc-20160816; b=kmZhI99kjjcLu9b7mjb2t5jear33xSFcAzFw6gCleEyjUjJ2K27VhBp3kdSNRXeVWR sTjpJYV33/9ElVbdZ8xdZHK1sbsGQ/2T4eqITjoXnDsHx4ihC2CWI4D5M1rMBlNS8eWR NdhuWUjsKVi7SPpl/e0evQLHMIMNxDr6GC2MvVDXNytMjhz3u7nupaCJ+6LRDcNUrVd2 EH7Qw1+xNk45A2F2m+yHHETqJ3dpkfoSU3T6FYI9CF1sWuWrwGuWFcCgLlV4r7GK/3t0 2LG6nCsMtaIQRJwfmDsbsuxAoSfL4st1bVthWvm1xJiF7ZbQK/hjgv1ruG3XiCOSVlHt NcqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=DTk/s8fzsUu66K9r3XiCb0g0cZz33jEHzEOMnHieuLY=; b=OOHuIcn5YPHCR2tA1OMJRfvYrIbP4vYfFClc+XGADRhHUEryKXzbyjGNna+LTA2NTP JF6i/Gx7GYnjMe2lAftZmTBqXrz2fOfuJEkwr0huIQMGVgGJayZNMnLoNA1elhb9Z1SO Q32SoOtMDCF6yDX+IC7fFZNw3cm+PYXX98hakjP7MF66fJ88g6PXHBzG8RoTxPGHkECh UQdiETUOeAIls8oB8hRCCfz6itIADQzoEIwuxdv+AkARZajHpJ4N80HWZw7ohmsO+GeO AZMw3WK5DOX1zQly1nBOASto+f116FTl1MUFzwx4RKohpl17JpH2PVMB3IRe6EkD6gAT wlew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XbgAMjdo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2-v6si6690394plt.374.2018.06.14.19.46.10; Thu, 14 Jun 2018 19:46:24 -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; dkim=pass header.i=@linaro.org header.s=google header.b=XbgAMjdo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965472AbeFOCpc (ORCPT + 99 others); Thu, 14 Jun 2018 22:45:32 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:37777 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965174AbeFOCpa (ORCPT ); Thu, 14 Jun 2018 22:45:30 -0400 Received: by mail-pg0-f65.google.com with SMTP id r21-v6so3780254pgv.4 for ; Thu, 14 Jun 2018 19:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DTk/s8fzsUu66K9r3XiCb0g0cZz33jEHzEOMnHieuLY=; b=XbgAMjdo2mfdEcv/vlbTL8TA1EqlO7p+cNMU4zr+ZW4URp2C0TqktuRGpgy+mNDXrb OPh9TvAPX6eVXt4iyIHlPu+gE314i5dK2z61TUw6Jx6sYZ6XZxUP+VyUDfqeaJGjeDHd X6brG4oN9mF8AqOU6uhLHngQtQQGsuv4puTzY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DTk/s8fzsUu66K9r3XiCb0g0cZz33jEHzEOMnHieuLY=; b=ZaEQxShd78u4B9OwUA0MJBoRCTaW9IasLcryeo5m+10mh27oI75gZhSmEUbT76GO7e jHKasmppU1n9I8TvOrQPtLFWU0yH+Ny8OV6AAOyuw/X5p4mr6uACw4ciSjzBiA9r1dPD z5nQiW4Hf9t352kkjUSjbLZI3Ghu47HMO6PrljNp4D+KqpypS+UfHNF5qN2DqV+X61kM Qn9NDeQbTEILm3dHOoDWZWlDS6FE8HkQQODYmXyD3GFAVYiqonYGYvraOJF/4NeE3oL5 1n3o8FPqoc7b3YLofqSxb3JFXKuT87ZTwS49WEnn0Gu0v6xESktLLHBfz6Dp4WDJaDU+ YZ/A== X-Gm-Message-State: APt69E38tk4fxxaIaZNxu5mNILUvCDldPWMzlPd7QeWCqr3cB/yykT4r iqMkRmXpg52YGV9B1C9BTRGSUw== X-Received: by 2002:a65:6008:: with SMTP id m8-v6mr4537316pgu.134.1529030729975; Thu, 14 Jun 2018 19:45:29 -0700 (PDT) Received: from localhost ([122.167.141.115]) by smtp.gmail.com with ESMTPSA id n25-v6sm9849184pff.119.2018.06.14.19.45.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 19:45:28 -0700 (PDT) Date: Fri, 15 Jun 2018 08:15:24 +0530 From: Viresh Kumar To: ilia.lin@gmail.com Cc: Ilia Lin , "Rafael J . Wysocki" , Arnd Bergmann , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] cpufreq: kryo: Add module remove and exit Message-ID: <20180615024524.5ecazjeufuiqmast@vireshk-i7> References: <20180607205827.1588-1-ilia.lin@gmail.com> <20180614204212.2028-1-ilia.lin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180614204212.2028-1-ilia.lin@gmail.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14-06-18, 22:42, 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 | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/qcom-cpufreq-kryo.c b/drivers/cpufreq/qcom-cpufreq-kryo.c > index 5e9511223ce9..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; > @@ -129,6 +130,7 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) > BUG(); > break; > } > + kfree(speedbin); Again, stuff like this can't go in this patch itself. It is a separate bug fix and you should send it with a matching fixes tag separately. > > for_each_possible_cpu(cpu) { > cpu_dev = get_cpu_device(cpu); > @@ -164,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", > }, > @@ -200,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; > > @@ -210,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"); > -- > 2.11.0 -- viresh