From patchwork Fri Nov 6 07:03:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 319404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6344C388F2 for ; Fri, 6 Nov 2020 07:05:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 897DF20825 for ; Fri, 6 Nov 2020 07:05:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="D6uqniTZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbgKFHF3 (ORCPT ); Fri, 6 Nov 2020 02:05:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbgKFHF2 (ORCPT ); Fri, 6 Nov 2020 02:05:28 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AB68C0613D2 for ; Thu, 5 Nov 2020 23:05:28 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id r10so218595pgb.10 for ; Thu, 05 Nov 2020 23:05:28 -0800 (PST) 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=vW0y5O6fj/dSbiX5076IJWx7fOAGTl35MulHK3/J9GA=; b=D6uqniTZDu/c8/5235+16Xko0zTWnNMMIAtUtOM/sIJ+qQZOdNWM4FVZCl/cPCrdQg GS8zHO8HsGGyUo9BciWRYPrv/1X0XAp+BnDL8B4nWCIzrKziQFfnxKh3gi4tjacAivfv iqjrHV3iRylbs5Q/gJcy3jIWkjyrw2Z28qDrHGN0d2nTb0DQ1/gxSTICRpsMqc9iGe4B ++aCDQ+oKHncRAq/O8yFa3OcqIvIzIp3pK9ZG196VoI4Fw8oLQ2/Nwd9wFkncXTr/OMI Ezp0rP0wh+Jsy+wjZolrQavV3CNbhP10hcz+etvW45EyNSGa/0yK0Ye/m+eL+TW0Xph2 t6Yw== 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=vW0y5O6fj/dSbiX5076IJWx7fOAGTl35MulHK3/J9GA=; b=WoZyQWIwlMh8R/0tFyBHVWU2NTMo7kgVxmqf++W00SJGlfsB0goiK6WYbn5StJzurr YygCuXzsRePxADq73nspWAcL8KYFJ9GgWTQrENIAtrfD/X7ttW3/mzinc01COaSVj70E 3JKHPcB+Noo3R8m20F6Ugd1UH9FAGuA7FpZv6jN3MGfkfgllDoGib1apVgS14yAMcxNg 7epf1+kZ6obFwcWgX8o9CtKABIRXDPYc2Um1wIknVeLzckcaWl31d0XR5uQUgeey1eCd 3PUFNB9zQnU1De5cArfxPz3dESRQnOQqfzj6sMGl/lvWsejBEglFkCvqcGQcZviFVB90 pIzA== X-Gm-Message-State: AOAM533WaobQfg2P3aa4TcmqpZmyvLMF2hwuVeyp4rU9n7SE5jrP9493 GhKfIF7/ayfXMhbIjXEILvhLQw== X-Google-Smtp-Source: ABdhPJx3V38k9UrFwXlITLr5bocrlJEnw2LA5dsBmBudBHawZuIukyiRESfoiDC7L1A0LcURRLsUwA== X-Received: by 2002:a17:90a:fa8d:: with SMTP id cu13mr926275pjb.161.1604646328060; Thu, 05 Nov 2020 23:05:28 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id x15sm978047pjh.21.2020.11.05.23.05.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Nov 2020 23:05:27 -0800 (PST) From: Viresh Kumar To: Ilia Lin , Andy Gross , Bjorn Andersson , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , digetx@gmail.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument Date: Fri, 6 Nov 2020 12:33:23 +0530 Message-Id: <86e6dfb0b929e525b568d80e5e852f14487d9b94.1604646059.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so there is no need for us to carry the extra checks. Drop them. Signed-off-by: Viresh Kumar Reviewed-by: Ilia Lin --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index d06b37822c3d..747d602f221e 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -397,19 +397,19 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) free_genpd_opp: for_each_possible_cpu(cpu) { - if (IS_ERR_OR_NULL(drv->genpd_opp_tables[cpu])) + if (IS_ERR(drv->genpd_opp_tables[cpu])) break; dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]); } kfree(drv->genpd_opp_tables); free_opp: for_each_possible_cpu(cpu) { - if (IS_ERR_OR_NULL(drv->names_opp_tables[cpu])) + if (IS_ERR(drv->names_opp_tables[cpu])) break; dev_pm_opp_put_prop_name(drv->names_opp_tables[cpu]); } for_each_possible_cpu(cpu) { - if (IS_ERR_OR_NULL(drv->hw_opp_tables[cpu])) + if (IS_ERR(drv->hw_opp_tables[cpu])) break; dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]); } @@ -430,12 +430,9 @@ static int qcom_cpufreq_remove(struct platform_device *pdev) platform_device_unregister(cpufreq_dt_pdev); for_each_possible_cpu(cpu) { - if (drv->names_opp_tables[cpu]) - dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]); - if (drv->hw_opp_tables[cpu]) - dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]); - if (drv->genpd_opp_tables[cpu]) - dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]); + dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]); + dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]); + dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]); } kfree(drv->names_opp_tables); From patchwork Fri Nov 6 07:03:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 320778 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1080211ilc; Thu, 5 Nov 2020 23:05:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkBLA45M/AhQpHYDHziUzMeFWrpSn5zp7itCI3GkC0I7vnZG0FDU8hF2X0Gx4RT6DVhFcV X-Received: by 2002:a17:906:5618:: with SMTP id f24mr671336ejq.381.1604646343879; Thu, 05 Nov 2020 23:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604646343; cv=none; d=google.com; s=arc-20160816; b=lCCEHWF7q5KGcNPt+g+6IVyhOXkV4D3nutUMVKXIqrGnUr51jWkuGbrEKU7f8xTboD zY0U3WJQCP8Q9iTJFTTANQEVVoAgRUTdakOHMOHAQXJA5PA0bkG1KVERduKiBMzwnsRj D2um317bg8Cso7B5EM2k84cj3E8P5jrfS1XkGwJQHYNhqJIz6w6ymCtQgFLn7n3pg48B tzKvjwJfP86tR1Eg9chyTnlTY0JogmdgRdbUb7N4+xK8BzqpxkWiKGA6Ep3bqS+sLKHO DjK/mbOUl6ZH6o5HHDUI4KlxOBNU4kQOw5EKXg9/r564C/uchVbpAZH0Hun1q7/0dPqP M3ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pxVky9l6SjSdLAcTA14Zb0ig0mPHGe9JAZ+xYlz+WWM=; b=Od9b75mj2raHBhpVk4UPx4nnq6dRw27ELr+ziq/xt+iCwZfaDjrQDO5EHip/P1mnFc vDL0Tf1ZBMT/bdQsJgCuubP/E3r/ytfKZt/r1b/VkzHVb6MtBdGQN7jx5bQHXkFxZC1N sPu2M5xelUAHy9GhZK6NIL1tMYotJUJbo2Cnsg6h/7Yk9xUQmnm4X++WjmAzF+0sm1x3 iYlO7I/17PvXteqVtQCGAWaaOLn7cfrtWuybUjN3r5CAfmy6Iq3ELSsgn3/NXjGWT1sM csRgQ/IZWJW03xa1ZNyBR3m4QHS4R5aYKlgr+v9o/7r90Ts7ev2danfoLDDm09pN8h41 /IHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mhYxA+hf; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 qh16si211734ejb.677.2020.11.05.23.05.43; Thu, 05 Nov 2020 23:05:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-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=mhYxA+hf; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726522AbgKFHFl (ORCPT + 15 others); Fri, 6 Nov 2020 02:05:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726543AbgKFHFk (ORCPT ); Fri, 6 Nov 2020 02:05:40 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3778C0613D3 for ; Thu, 5 Nov 2020 23:05:40 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id b12so246245plr.4 for ; Thu, 05 Nov 2020 23:05:40 -0800 (PST) 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=pxVky9l6SjSdLAcTA14Zb0ig0mPHGe9JAZ+xYlz+WWM=; b=mhYxA+hfdYdKmPXf+5Uz0ENmGw87DnvuIRtIBfijjW125XoltnFPxPeJAjShhP1zZF CzHGGfPvrH1yEQCVgAcTfBZmHN3ABIvSHx1IaK5Trurbt0YMJtiPt0HhqXRbpPJ7pVmw Vj9iWoAHCCUyS23qBnzK518EtYvDXqzPRzD0KsDn1kPn9/XpFBg2Fz5UJAuSLVy7lRd7 d/ecLj2XoE46q4rsnj3OKtDW2ONjIFyjbc8J9B5IHqJvNzST0o4vuKdObU+KurINcgqS 34l1mY33qyM58jFdL+CPsZjlLQggsMs2cbeoy9a1GJsRw8pcgEnwd54lhRdiCdC1/vfa XVbg== 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=pxVky9l6SjSdLAcTA14Zb0ig0mPHGe9JAZ+xYlz+WWM=; b=L9AlmmImkDeW0YyLsQBpluZZnduJE+7AZur8e33Cp7KVIrmmqdOU9ZGnQqznyo4Tve nMfEyldRGAvl5ixcbggxXO1uOgtT040Qre380ZS1zDu0ztopJwWCmFTnqD4ZSCIgZa3s Bi3ux0o8AUyGOIJuXSbv/V2Zi/mqkOTKFK2aY726g/xDbXv9OSoBR1gavaIltI0PiRcG lae9eMcS8KS8Vp2VDs2mIgVYTY3v2bY3vp1MnbJGkOUAZ1YA3GfEAQMKGDIxogyRz49h o/i4ZA97x6HDe1t97pYrKWxQGdBlvn8qaDwVOZFX5lbBK0Sgu2sBVokmDgreK3vR/2xy 7bTw== X-Gm-Message-State: AOAM530gZj614oN+XwUxA/1Ijd+FL9Bi7TGwSi8+o/VrvtYjqoU/PYry Qkem0UW1h0jIqeHnkYuT/FmeLQ== X-Received: by 2002:a17:902:6ac1:b029:d6:c43e:a42d with SMTP id i1-20020a1709026ac1b02900d6c43ea42dmr719733plt.21.1604646340242; Thu, 05 Nov 2020 23:05:40 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id z17sm551372pga.85.2020.11.05.23.05.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Nov 2020 23:05:39 -0800 (PST) From: Viresh Kumar To: Stanimir Varbanov , Andy Gross , Bjorn Andersson Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , digetx@gmail.com, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] media: venus: dev_pm_opp_put_*() accepts NULL argument Date: Fri, 6 Nov 2020 12:33:27 +0530 Message-Id: <1b1c2086f01a27f7da6e6512dd47d47d153f626d.1604646059.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so there is no need for us to carry the extra check. Drop them. Signed-off-by: Viresh Kumar --- drivers/media/platform/qcom/venus/pm_helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 57877eacecf0..e1e9130288ad 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -898,8 +898,7 @@ static void core_put_v4(struct device *dev) if (core->has_opp_table) dev_pm_opp_of_remove_table(dev); - if (core->opp_table) - dev_pm_opp_put_clkname(core->opp_table); + dev_pm_opp_put_clkname(core->opp_table); }