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: 11726065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D28E722 for ; Thu, 20 Aug 2020 10:44:53 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63BAC20639 for ; Thu, 20 Aug 2020 10:44:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RyqwRpZw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kdJLB6xv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63BAC20639 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vxKDUjJ5M2w4RoI9cy0NHzgIRc8ZEpUITRjo1lyM9+4=; b=RyqwRpZw8bsc5789wPaFmzs6L hK46SVSYUQ1fkJJSVioqSy4JNk2YYIw6kDoHmD2rcFAufM2ItY9Kf7mUYE5kD3GWq6HH0uUgBYFgJ FHn0jDxvWmFsHm/gAVADA3kYB50m9Dl+9Q/YbgUICZ1a5VU9/KX2NVXECGj+Zr8owoLgoUqgOUM7u QrFv+XX/nBx+vr04NnLIlffCsLkHXGUqMx1FRNoDu2n963zhMaAK7IUg46AoRra8houUS8nx822sU 2xEWujNOEhxIvWujz0t10kuc3NO5kyTDG54hlr+PyYcZSrjyielXLNefBHjpTB+ctnkHFLLmyLjUX gg43lvz6A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8i3i-0006mC-B3; Thu, 20 Aug 2020 10:44:38 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8i3R-0006gt-2D for linux-arm-kernel@lists.infradead.org; Thu, 20 Aug 2020 10:44:25 +0000 Received: by mail-pl1-x644.google.com with SMTP id y6so738508plk.10 for ; Thu, 20 Aug 2020 03:44:20 -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=pHJ6D+wh/7LC+DlqqLFol2ECoA5o9hZRWXNB7oqFsyzzSET/JFvhk4AsJXSFtbt+Nt IqyNWnZFnrVNKKruUIPRU67T5xvQS3JS2Df1uIlg+TSUAGTLBVFGD0uLNMNuevtsrJdm IOnJA9AaP1KV6c7OVU6GPzvtDtCx8hFSp74jNd++p6/kKw/s4JMoXxbl0/5GuySP4nuw ncw/V+yx2zS0A0xwoaGzK/xScZw9vpSHpG0kXaR4PAlIEI6kGxyIdaoWNgxUm6IqIxQp GhYsvNwYxdJSDNE+WNmS+4wzLSLqF0XwYNxe+Mf2Rc34ijwExxPFQ62kML7fORNUOTpE MVqw== X-Gm-Message-State: AOAM532nwzmwoxQ88Ml5tJFh+gySwRrHCrIAhjMKKbJXpsgALYg3nkqC FvAxw8mW61OySSDX8UVAvm0BvA== X-Google-Smtp-Source: ABdhPJwYvC+Z5ZdgGh31gUC2Q60ovUZ9XGSX4w1+f97jUslWlDxDur07VZVEPifi0eTRojgeMah0+g== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200820_064421_174742_539EA3BE X-CRM114-Status: GOOD ( 15.87 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:644 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Vincent Guittot , linux-pm@vger.kernel.org, Stephen Boyd , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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);