From patchwork Fri Aug 28 06:07:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248463 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp799444ilg; Thu, 27 Aug 2020 23:09:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynFkIv5ZDuCkj4fh2YSEsOtRxOYUNl0a0UrI+gQzO44bfXSa/dNEUT/RICzn1MvIcJR1l1 X-Received: by 2002:a17:906:69c9:: with SMTP id g9mr173551ejs.313.1598594947462; Thu, 27 Aug 2020 23:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598594947; cv=none; d=google.com; s=arc-20160816; b=dWVgZPBjcAMKKB6dav95nlDwt2jH436uuAtYBG1UJL5njmsLtPuDRBYdi07LiK+9q1 A26O/5RobZ+cuuNlMyPKg79NqVixi58YwoNIZ0n+KP15hAy2UQjDx6fNWK0qClAxDPDo VOc/MN+Ebu9ypZg5Q2fmkW/VFnH970oJk7LKggOmzpziwpAuP2lYeit8CBkZN2lAC2H4 nV4GzxJ9zZ49kqpPbfXzROqwunARfZ7IYp1CIPS74uuMFK2owRv15lcnwTJLN8AqKNs3 haQ5gG7SLQsXpiiApdNBH9S2dqnJ3jGYT763/Q/Q1x3MLW084jaSmqCWRzSy5RB/Wfqo Hubg== 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=6ltB0x29xQVj68tlFCXWk/tYz44PXtyGE60oP/+ehOs=; b=gpHTs98S6muGJ8M8nOav2MrdlT83iV9X1r8U1xGXtxZx4funOLdmcHd2VJiXyPNpIi jyNbTFHvgA6Jun/YB2LfJ7HW2eApaMKZS97JK6wisZE5aA4NNrhvHoBgdG8kmV9prQRD 5K0xpa8gXNkCSf1wmPxYGE7T98CzmScQLaPT8oSpQnrB7h4FJxk66NnJDhhlWcMY8ctf rjoE+VO/woYXCBty/P0axFYSEXC/+ASYtzGu0VkC1ejohtddQP9uwvu3ajbq5uJ+Jphg xWn/sS0ifOjk6lh7mIPleYYAX0dZHd4ioAxomUPERSQL52xuYE5kb13DXp36/itHBdXY LLCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rdyR3brT; 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 ks17si15699ejb.204.2020.08.27.23.09.07; Thu, 27 Aug 2020 23:09:07 -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=rdyR3brT; 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 S1728468AbgH1GJG (ORCPT + 10 others); Fri, 28 Aug 2020 02:09:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727964AbgH1GIU (ORCPT ); Fri, 28 Aug 2020 02:08:20 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D86DDC061237 for ; Thu, 27 Aug 2020 23:08:17 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id j11so1425484plk.9 for ; Thu, 27 Aug 2020 23:08:17 -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=6ltB0x29xQVj68tlFCXWk/tYz44PXtyGE60oP/+ehOs=; b=rdyR3brTWRm2cdYTcp4hJs26JKuqhOUxZKUhjd8MXxr61ST+mUFJHEa0bdPMaXG2ai Yr2/H4WF08CrEFfnDljGlqo5/eZ6LNqfyv3qFfb/aJ+8RL9VgUNjNIni8nUqcIpzTbLP r5iP2wfqCqFOUeDuFRjvUpkmVpqXSnq1J7/NFFwUwtqYqiqICTKGaFhOI+xi59PZKZfl NmWVqYo4UwOfqI+yDmOIuLBeg16/LA2P7QPjBVgUoz08f9c/4i2hO33MvMVeVP0+67Bj W1lMwXBt1w8cIXpfXxx6t2GTwKq3QmGxQ8PUdabh9Vtaj9A35dOSKNBygH/FrbxJ6kaf qFTw== 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=6ltB0x29xQVj68tlFCXWk/tYz44PXtyGE60oP/+ehOs=; b=Ccwj31K98+n6ZiJT0gi9d+SbauEvIYsUroVh0ao9mn4x2Epf8N1km8JlmoOjbq9Gzi Ei3PxXC+SHCnvxK4oZDyvW/K2HgZx/KTL4FyCwQ//6skDNZTudeL4eAlFXdsM/u7xDOw EJZihdIzAmgOm/T5QqMzYpIlwOS1g1//GEwQzXfY8O4PpBexdC0ZmdTJULsRig/CBUmn ak8ktSnpprmOt+mRnNnPqQVq4gn4X7apdhOfCMtvmiz8dOTHQkqDsSVyku74HQ+snbLE 0ENZinPE3/q63Hb5VQSTjnEquzfIREqgssAZq6Fq40LjYLiB91noqwXddvPcoqmXRyCr Jwxg== X-Gm-Message-State: AOAM531KWUK1D8jTLOTbxFNYqscC8UpL263NPY0YJK9vs2I9eGPO+HIi 1sM05lUfEe6HfOLPUNXrIOjODDKGjomqEQ== X-Received: by 2002:a17:90a:ec0b:: with SMTP id l11mr303206pjy.136.1598594897414; Thu, 27 Aug 2020 23:08:17 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id u14sm149783pfm.103.2020.08.27.23.08.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 23:08:16 -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 , Douglas Anderson , Naresh Kamboju , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/8] cpufreq: imx6q: Unconditionally call dev_pm_opp_of_remove_table() Date: Fri, 28 Aug 2020 11:37:46 +0530 Message-Id: <84dc113f3ada31c858481077d7b535af2765a084.1598594714.git.viresh.kumar@linaro.org> 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 --- V2: No changes. --- 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);