From patchwork Thu Aug 20 10:43:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248028 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1234548ils; Thu, 20 Aug 2020 03:46:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvBr8BWLdIILmQG0+f1/ODSZiiq13kHvcaubaA4z461XG1UGLFDu2BeQRxyV1BC2KBXvbJ X-Received: by 2002:a17:906:73d9:: with SMTP id n25mr2752820ejl.412.1597920388395; Thu, 20 Aug 2020 03:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920388; cv=none; d=google.com; s=arc-20160816; b=aMevqnyTF93VsuH5jAvwW3KNF2fZoZWWmVAu3pXfFLvFVhn2OMQW4l5A4kwuxdAvOH DanckEdF+Y2W+SotmLjCHDLzQd125inG5PjyuZeFLhj90FbIPFgFc7o1l3M2ee8OrkZs cIObgv/imsNrht/anoQR8pSYWrKInmR9qKpvpgIi2jrQdGDtw8dqWofLIEvC9XKAlykN Ua8nGK5QFvGXjiMMSXM2D1bGASKG4wq6JfdkjFoqT/99JtVrX3vAu73n5/QnxoxTZqvv mE/W4FIEZ3X/4pg95mB1A9eLA80H0i568Eip8L+CX72NfGOwyszJwiNLOwX5dDE46TFX vjFg== 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 :dkim-signature; bh=RX8jH7WYd4F2NVJ6VgmGb3ASYy7lGOBAgdZtCkqBvgg=; b=jkAPNwRS4lX7ftMbNpUMt7e7U5+9Li16HFeHANpUnkFx64lIm32UWqNUka6GkI6qac JNjD0b2ngbD8HmwyGucG1PYFTBDpCz6gI5hd3oArd2YNbmBaLc62NdbasWLvnhYf4xjt K6RUfvuStpXmTxG0xQ/Tu2Ukzv7pbn96HCLzJL6KjGd0jc6NAnos+6vKQHYvCtJISQsa BrYkGYHThVolsJGPAKBW1f2BhrWKaNES65mRS2MdPx6E1WKEzTS0h5dYcyy8l7YOTXIv QMnf9hGqDkAW+IKaz1nTMU0dZvhP5bi4l4fNww48B/U3lDlQbCSr4vJa/8ygi5psejLa zhMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kdJLB6xv; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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. [23.128.96.18]) by mx.google.com with ESMTP id w12si937182ejy.64.2020.08.20.03.46.28; Thu, 20 Aug 2020 03:46:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kdJLB6xv; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S1731320AbgHTKq1 (ORCPT + 10 others); Thu, 20 Aug 2020 06:46:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731888AbgHTKoh (ORCPT ); Thu, 20 Aug 2020 06:44:37 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B573EC061345 for ; Thu, 20 Aug 2020 03:44:19 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id bh1so734068plb.12 for ; Thu, 20 Aug 2020 03:44:19 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=RX8jH7WYd4F2NVJ6VgmGb3ASYy7lGOBAgdZtCkqBvgg=; b=kdJLB6xvJRzMw7YX5ULxAs3uZEqeFAoojfyPwZGYu+aBdj6Ph7yQ0NOWZklMEqNtVg CAg5NoZLrksr02/KRsMQAlBdpxV7alLNPycJflXgUYlJ3YGYTSgE3Yt2sulqK6O3u74f 0pPfT82L00RoAauHAovkXrF0UhOb7nt4XEsR3cCmZbPyRBk46P02Ih5tAQk4QMotcLEb FJLOVNuynnZvkkJZUNxNZnxweZRXDIxbcv6Mm61B6vWMhgvLjBUhFrjJI8wDk4tSxgFz Ze/Jy3wG4otR5A+kN/cKBR1hw2oMICfuKmcfrXw4vsmU5k4Pgd7BifURwVtXbU5lhD6R xfPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RX8jH7WYd4F2NVJ6VgmGb3ASYy7lGOBAgdZtCkqBvgg=; b=JKRnlGHCh7X3AkZwqfNTQW9ZX0GDQCTpruoaZS6Qs21DCYJGapWvjh//AFYATzzryi pDpap0i4t2SbpbwojluaCFT5gg/z6ckHW8zC+h8JL9fFAL2elz86XJkjXkZMtWnF4a0A mOI7LBitYHFcihYunEmbREQaCtM3iXUaf/4FsXrDiAP4R7m9YveqV/ZPBGuefoO0Cv9R WBfreelYifWXwLUv1y7rBu0VF3lC7z0qm8dBNvB6LX1PyrB5dzpJIdZ2m5xyx5kfjmcp nSxLknMKqh+b1emwBcvaN6g1PP1AyoWRoBwIbAomGuhGcE6VALBcX+SAROI6zVFGo84F i5Zw== X-Gm-Message-State: AOAM5310NMQhUrgyhnHTxsJzi4XDut/RSn/1OHf7/2R+km0vCRqN/drx eUk5QrazividQ8tgIstzYSFBKw== X-Received: by 2002:a17:902:ac84:: with SMTP id h4mr2112048plr.334.1597920258939; Thu, 20 Aug 2020 03:44:18 -0700 (PDT) Received: from localhost ([122.172.43.13]) by smtp.gmail.com with ESMTPSA id e125sm2435256pfh.69.2020.08.20.03.44.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 03:44:18 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, "Rafael J. Wysocki" , Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] cpufreq: imx6q: Unconditionally call dev_pm_opp_of_remove_table() Date: Thu, 20 Aug 2020 16:13:50 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org dev_pm_opp_of_remove_table() doesn't report any errors when it fails to find the OPP table with error -ENODEV (i.e. OPP table not present for the device). And we can call dev_pm_opp_of_remove_table() unconditionally here. Signed-off-by: Viresh Kumar --- drivers/cpufreq/imx6q-cpufreq.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index ef7b34c1fd2b..5bf5fc759881 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -48,7 +48,6 @@ static struct clk_bulk_data clks[] = { }; static struct device *cpu_dev; -static bool free_opp; static struct cpufreq_frequency_table *freq_table; static unsigned int max_freq; static unsigned int transition_latency; @@ -390,9 +389,6 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) goto put_reg; } - /* Because we have added the OPPs here, we must free them */ - free_opp = true; - if (of_machine_is_compatible("fsl,imx6ul") || of_machine_is_compatible("fsl,imx6ull")) { ret = imx6ul_opp_check_speed_grading(cpu_dev); @@ -507,8 +503,7 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) free_freq_table: dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); out_free_opp: - if (free_opp) - dev_pm_opp_of_remove_table(cpu_dev); + dev_pm_opp_of_remove_table(cpu_dev); put_reg: if (!IS_ERR(arm_reg)) regulator_put(arm_reg); @@ -528,8 +523,7 @@ static int imx6q_cpufreq_remove(struct platform_device *pdev) { cpufreq_unregister_driver(&imx6q_cpufreq_driver); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); - if (free_opp) - dev_pm_opp_of_remove_table(cpu_dev); + dev_pm_opp_of_remove_table(cpu_dev); regulator_put(arm_reg); if (!IS_ERR(pu_reg)) regulator_put(pu_reg);