From patchwork Thu Jan 21 11:17:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 367818 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp490926jam; Thu, 21 Jan 2021 03:47:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcQN1xos3ImSpEctwpXR1OicskEVSVff/trm7hzRTVVpggpyMSWuQxExJWFQp7HoMebbu5 X-Received: by 2002:a17:906:58c8:: with SMTP id e8mr8914705ejs.475.1611229663636; Thu, 21 Jan 2021 03:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611229663; cv=none; d=google.com; s=arc-20160816; b=kw08eC/0VcbEaCLJo8yxkt6GnYStoRph1lraQWAdII61ZIwFHsJ67u+Xq3BzRet0YH 5jd99tmsk4NZkt4DSGD0SQpIWnK1sCIbexovcv2KWHWA0xQX8BAIPJx8+JNG2KRrYobp igNDYLe7H2fTbtOHU/qiNacD2rqjka3+E9cfDXr0dXXkryMmh2HQfJJRaUOP9d2AgDif BQ4hppjwzz+sF5VIXVC4el6McIYWtun2RLCj2B6wbDXKF16mAEcp9i944+PGTp5iZ9xe Wld53aZQoBVvYr7SUTgiC9StQgz7NFyCkEM0r2LINzcvToL7Ge8lV9I/3u7HT2I1OONh PEpw== 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=CYbzCFVCi3fEgZJohV5hqu59RAY6Et7w7QbAOId9XrY=; b=RHl22dTbgizhaiHQcvMtzxwvMW41OOXGIDCi4FgW6dazJl5KLrMqxj1OFzMyjiXs8P 8WUN/q679IqtwGnYJGW5/Wwrz6cA4ms65xkN0Hc+no+XJOlPbEfprUbvjf6pN9e2ywAU f2iW+wP8ATlggdyjOIrL3Ppt2irz1Lc/tkKj6xghJP6VIbxZFLBRC1I/2xQKiwjt+q+F gi/cyNQAKL7B/Vc7ay+UZDDURZjM2a7SGQWDOj23uXcaGy2vjcpFfu9SjkrMSB8Tiqy3 Zdj+fiwv7wvzEtWgnWjjHC30Mj/fXKhmiurpwseHW13D+FwAyPvnY8CpjtfGXz/1ARvV RlVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lMZb9UiN; 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 w4si1683299ejb.499.2021.01.21.03.47.43; Thu, 21 Jan 2021 03:47:43 -0800 (PST) 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=lMZb9UiN; 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 S1730147AbhAULr2 (ORCPT + 7 others); Thu, 21 Jan 2021 06:47:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730076AbhAULVX (ORCPT ); Thu, 21 Jan 2021 06:21:23 -0500 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27548C06179F for ; Thu, 21 Jan 2021 03:19:04 -0800 (PST) Received: by mail-pg1-x530.google.com with SMTP id c132so1166535pga.3 for ; Thu, 21 Jan 2021 03:19:04 -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=CYbzCFVCi3fEgZJohV5hqu59RAY6Et7w7QbAOId9XrY=; b=lMZb9UiNz5IoKRjlVfTRbe5AbsFjgYug6+3rBQBORQMTS2UMUtLozNugVAnuXzVu8y EYEMj8NSmofsA6xXlvjPMTlIYrPcpAfABG+1v1OmZz7r9X5YWSkh16Cxrsokim45C5sJ tUjvk+6bmsgYppq/z+2OjYh9iv2r6nSz0qXHsQ+GHP9yy0kYl4kID2DhPeeyCjK4vjlb Icdu8T9ko+aqp872q9wMRgxdPOSbnY8xrtxNYrFWzjrxlAklUobL0Gl0pA9p1ggkdKGE zQrS52KKBl/kFz3wQD/xWCCxYLYBNGWJvjbTLdPsvcwnxS60d3h0uiITwge2NEyNxN4s 6jvA== 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=CYbzCFVCi3fEgZJohV5hqu59RAY6Et7w7QbAOId9XrY=; b=RHsda/T8lVJigRUInunsCkeUMXJUn7ZFF74HgfK5rsN109Rq7bJow6ncggTvJivUC7 3XQWEllzlvhDxSXVHbUEewv+D6q44aw7anUR08X5nDL/chyhTr7ScymTmzNh6z0OTVid 6qlXo+Xlc6YCbTQODulPhCbH++zYDN3jqD5Nr+zQLx2TQTQB34E3UmIwVcgi0gisOyre 1y1ksTDeHbIkaK2PHq6Jet33FgM7zz2e0kGQtt7j3W/He/Uw0L+2Px7UyPHAQRjUaU+A ESXd+sbElp35wkpyW7ytsBfcP73uF1mNS6TEgI/duus2T+JC7hPZcWvEiZoMzJ7TDO7o Og3A== X-Gm-Message-State: AOAM532Hnr8pK8+QpUn4C245P9iw9E7Zcsvsz0lN6ZMHd3P1M40+jUww txpbeRW/JZeu+3JZdiGQPWZoJQ== X-Received: by 2002:a63:d42:: with SMTP id 2mr8226764pgn.236.1611227943683; Thu, 21 Jan 2021 03:19:03 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id w21sm4497087pff.220.2021.01.21.03.19.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2021 03:19:03 -0800 (PST) From: Viresh Kumar To: Dmitry Osipenko , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Sibi Sankar , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/13] opp: Allow _generic_set_opp_clk_only() to work for non-freq devices Date: Thu, 21 Jan 2021 16:47:47 +0530 Message-Id: <1585f6c21ea8aee64fe4da0bf72b36ea4d74a779.1611227342.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-pm@vger.kernel.org In order to avoid conditional statements at the caller site, this patch updates _generic_set_opp_clk_only() to work for devices that don't change frequency (like power domains, etc.). Return 0 if the clk pointer passed to this routine is not valid. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/opp/core.c b/drivers/opp/core.c index a96ffd9051b1..6b09d468d37a 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -726,6 +726,10 @@ static inline int _generic_set_opp_clk_only(struct device *dev, struct clk *clk, { int ret; + /* We may reach here for devices which don't change frequency */ + if (unlikely(!clk)) + return 0; + ret = clk_set_rate(clk, freq); if (ret) { dev_err(dev, "%s: failed to set clock rate: %d\n", __func__,