From patchwork Mon Aug 24 09:30:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248168 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp2388724ils; Mon, 24 Aug 2020 02:30:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGNuLO8TX37dmAcMO2DM0BZSDSCSmfT7UsWlidFtUsF3JTn5m03KdE4icn1SN8lECnB+Ug X-Received: by 2002:a17:906:9589:: with SMTP id r9mr4534867ejx.320.1598261420862; Mon, 24 Aug 2020 02:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598261420; cv=none; d=google.com; s=arc-20160816; b=H34EAx0RKO9WU+aIE6No0a/VsbzMZzFC/Rr7HIfPKsoSsV3cZ8APJiusqpQUiHVmDK jBE/kPQrf/d8ccyWzzlDCsTx5/yW7gI3mHU1Hpj4hvRSPhJCXoLI1RXt6MvWQ/TK34xO ULhoR/9LbdoSaHDeqsDqc/LCxGT1M4BgfR3nHGC+/+wr2SX3P9LNWED5OQ7pJwGmj+XL FmGcLr/nLX863cfmXkcga9qktYztKnJTeLBBCC874XUytkhKRGgfTbejr+uD0UVA21Vh +sswPrcgE6EMFSlBjz+tdS0FmKvYGZFSAbzVlkxVKbCq6E2T8HcM5NUcDqNnuB5ZddV3 4O6w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=pK5bVNvEUkGmkHt7h+22p1PRjllmkBfGKoPd86o06Lw=; b=y0vUA8I399ekVKSqe/zkQZRicCqiSxxxPEaD0th8QMLdvSWQ07hEoypzRLKO0s2Sty dTtM08Liz6oMGjxfFXhmfEfw1z5gSdjKDnv/YROFxL+Vmg/o/i7p/qshHgb3uC3Z1X2z r8W5znY2Ef169MJfr5Wh/muzQM41wxndOMqHepumptVgwqUMBxrZFnU30VWAADD9mrBK csfMUB7Q0r7aXiuwpYZU9T1BP7hM84TyaMIcsAoa5y/OZWLDtvMGwGtQ6Yr9RhIVWkxd JXT/lrdYQbqDDKW/pF5sBug7eREStYgP4489ObN1+aCnsKe3mvMRN5VMszr2okTTBPFR J4nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zb6H8ukR; 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 g6si6698953edw.30.2020.08.24.02.30.20; Mon, 24 Aug 2020 02:30:20 -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=zb6H8ukR; 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 S1728543AbgHXJaS (ORCPT + 10 others); Mon, 24 Aug 2020 05:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728432AbgHXJaP (ORCPT ); Mon, 24 Aug 2020 05:30:15 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E12FAC061574 for ; Mon, 24 Aug 2020 02:30:14 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id mt12so3974816pjb.4 for ; Mon, 24 Aug 2020 02:30:14 -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:mime-version :content-transfer-encoding; bh=pK5bVNvEUkGmkHt7h+22p1PRjllmkBfGKoPd86o06Lw=; b=zb6H8ukRfhieLWr3DBnUXOTmg55+e5EVKeqsfa2altwwB4K1VmjB+xm8dp0KBc1B0F KH/tRUbVH5H9kDw1etY4+d/Urtgr+0Uix5vBzCbL7jtkQ1eORBWByV8kv2G/GTNO34Vt mSH6FAZHzaRAefjA6cu7fJfPaD6DxdXrTBmzBKhB6v3cEnUrPrwh8faxFALumEMVOqJA CTTMXQeHQ8MSlQBI1kcnwyGWnp1vQ2Y8z7P0NgI/6mlqv0ZgTeOsB4RhP2gBC/WJvl+H E/7v/z49lP1blJipG/yCn02u9NiwT7GRfdVRKXa+EBMMQvQmxFyFlkyzbmIzDvLjy4lx 1+hg== 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:mime-version :content-transfer-encoding; bh=pK5bVNvEUkGmkHt7h+22p1PRjllmkBfGKoPd86o06Lw=; b=BYAVCixrz1TI/ZwNF6WDJ+7MFm0Lju+NNB/WqtK+M7pME/OzK8hJoC1PZLQ2iquD4t lja/hA27tPetJn9+aKHbDk2e+aYfIZMfodxQ2+8iSDE//E4j51vl9lAzF/IGe4XEhVr7 Nnz7Fw0sUjkGIgt17B9JJ6NKN2uY1PttemOdepeXLLKKE8MIBCInScceJNb7R9fJQ5o6 Q0HpDMcaTkOT2w+Jl4A0/lt7c7kMHvZ1ZsP/+6QS4mPiYmctoztSXeu7Y5HgRnxhY3Pr 9U2arlaCdtvvikzSXUR/tQ0LtfbixkW1LryMoHrcZW8uDQ71pTLi+UPYE429Vwpaz8Kc 0kjg== X-Gm-Message-State: AOAM5301fk4f/4ZR7tdO5n5ITr1zUSkXrZp9clMvFzPO0ZZG2eWnKt9K FVY2EyrHmyLATI1GnC0nr86Wqw== X-Received: by 2002:a17:90a:448e:: with SMTP id t14mr3829392pjg.59.1598261414267; Mon, 24 Aug 2020 02:30:14 -0700 (PDT) Received: from localhost ([122.172.43.13]) by smtp.gmail.com with ESMTPSA id y3sm9647312pjg.8.2020.08.24.02.30.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2020 02:30:13 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org, Viresh Kumar , Nishanth Menon , Stephen Boyd , Rajendra Nayak Cc: Viresh Kumar , Stephen Boyd , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH - for v5.7 stable] opp: Put opp table in dev_pm_opp_set_rate() for empty tables Date: Mon, 24 Aug 2020 15:00:03 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Stephen Boyd commit 8979ef70850eb469e1094279259d1ef393ffe85f upstream. We get the opp_table pointer at the top of the function and so we should put the pointer at the end of the function like all other exit paths from this function do. Cc: v5.7+ # v5.7+ Fixes: aca48b61f963 ("opp: Manage empty OPP tables with clk handle") Reviewed-by: Rajendra Nayak Signed-off-by: Stephen Boyd [ Viresh: Split the patch into two ] Signed-off-by: Viresh Kumar [ Viresh: Update the code for v5.7-stable ] Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/opp/core.c b/drivers/opp/core.c index bb7060d52eec..c94e725e6522 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -820,7 +820,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) if (opp_table->required_opp_tables) { ret = _set_required_opps(dev, opp_table, NULL); } else if (!_get_opp_count(opp_table)) { - return 0; + ret = 0; } else { dev_err(dev, "target frequency can't be 0\n"); ret = -EINVAL;