Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp109980pxb; Tue, 10 Nov 2020 21:56:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHqRUCYMNSZqbDhC4POM9beicG1EyyjUNlc5+RAiyjOkKjPeCobHIF5qhuzGlyqqbQNo8i X-Received: by 2002:a17:906:9458:: with SMTP id z24mr24445366ejx.318.1605074177340; Tue, 10 Nov 2020 21:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605074177; cv=none; d=google.com; s=arc-20160816; b=oK8LVg+OSWucChHZOVKp1wOW8tUrV80ixm8hIgoPEVSzupmq13jC+5AjyZImTBxyam 8o1Bujkq9u1YNGdKQNZ77Y4y84qcBLlAKr/tYPf4E4Lk0Qhbjz7oXeEUh/J9wZeaGHHr QM2oB8RKCovA+rQXGb9aY5GhmnWcZnl6BQzRafGWwCqZXd38gRyfaj8/1cwIqglwRH2g xhApa44B27iwIqaNRVNE8WEaMIpLDAx431dQPaZsqkUkmAWAP18F5L0+znEFZ6Zj+b6a iu+eUB77c0W1ul79CCNLLxN43UbiITo8PDMNHww5MA3gfzIH0QzQU63+HH+3X3Jhzn3t TlPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=z9P2/0O75mWnsAx8oZbLnThzZUiIC3AEplGBmhCEgMc=; b=sQUuz98+rO/0O9om4GmeRoL8EJDE0mbaOyDWzG1uJadsf8X1zUVm5jV9RHVKu3DdVn 5pRfA5ByTCHyle8CxaFvTPjkgorkTUPQ2PtgRmnGO0Ss3m8xFJzofdWOgv13ZmxfUdZG UkUgpB9uSdhCp6ttOQJm6pX53R85sIcEc2UC0uVq8oQ4QFcWzdzkAdmmjJS1tWLaWavZ wcwcRhKmQs7zDmhb83+Sft7YCstIASnsyYPTHHfWHuspKF2h8jPy5XG27NrrbO+6LZzd Cw6KmwakaSZ1Mqffwx/fs/S1NCmCh3Z6pdUXEbhS4aZ3/p+iKgPeSA6xtg7eAjYnbM99 m8gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X8GTCLnV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 bo13si563925ejb.463.2020.11.10.21.55.53; Tue, 10 Nov 2020 21:56:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=X8GTCLnV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1725976AbgKKFyF (ORCPT + 99 others); Wed, 11 Nov 2020 00:54:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbgKKFyD (ORCPT ); Wed, 11 Nov 2020 00:54:03 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7099FC0613D4 for ; Tue, 10 Nov 2020 21:54:03 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id h6so767476pgk.4 for ; Tue, 10 Nov 2020 21:54:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z9P2/0O75mWnsAx8oZbLnThzZUiIC3AEplGBmhCEgMc=; b=X8GTCLnVhPTHspNJxX3km3UYVp4nyC6BpfIOKE/DdY+uRQjvemgYnXh8VFokLkJrAS ZqtHrunQPVA9pFblN+6OYjTpS27k+3qzxsRuUbq4xgpRKXK+MQAEhjzLGXROppqWR9D0 5jdgnPnuQCRevLav+EcdMJ4IWzhFftP3TpovBCaNjMjTSrs7yC7Sk5VEVbDt+MzoCUXt D6rESQcjx+u3Y2fMR5OPaJ2B4YTZ8PyAUAjs5NFDAJZU5Qrvtoa6xjdZuBPIoyggPRl9 JHkOBKUfFnzo79XoomjoJgY7H3V/Q9sVxWPcTdq+Nyv3t8MJb6qbybYDXvP5J6cgEFKD XKQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=z9P2/0O75mWnsAx8oZbLnThzZUiIC3AEplGBmhCEgMc=; b=qqGSruE0G6r3W83EyQJsav1MQMzWXpEY9z7i03ES6tWs7rpYWaZ3gOpYE5Eymo+Qp5 tkuu3GTQYFRLrZl7N2qSh5hl6VXeq1raMq6A/9cehv/mb2mgdZ0RJ0lG33tQkXYGLgxX P0+EPaYwSXPhYrlqK42piTh4ur2Ep1iDPxkWAGR9XLlX7ZipZHTsq3qgCOJq9cT9KJVS KlN1xQkI2/TVeEN3tYWMrL5K7vl5nKYh7Fjf5bgdVJQkJN07oaZkOAL6eY6036xDLSYV ljEAX35k7MXt/o4Vs1NcmcQPwGafrFaxQzjAcF4ZvUtB80dmPXT8KQJ2gxEosGzOzJgc NxOA== X-Gm-Message-State: AOAM533adWN3xivbX5fqTo4UoFLeWnwO31ahkez3fk/BEF+S2OsncX55 TgsLdWqy95weYugpkSUevTXPyw== X-Received: by 2002:a62:7883:0:b029:18a:e054:edf1 with SMTP id t125-20020a6278830000b029018ae054edf1mr21361245pfc.70.1605074042985; Tue, 10 Nov 2020 21:54:02 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id p4sm909594pjo.6.2020.11.10.21.54.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 21:54:02 -0800 (PST) Date: Wed, 11 Nov 2020 11:24:00 +0530 From: Viresh Kumar To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen , Viresh Kumar , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v8 02/26] memory: tegra20-emc: Use dev_pm_opp_set_clkname() Message-ID: <20201111055400.7lnooqnxo3yy4gif@vireshk-i7> References: <20201111011456.7875-1-digetx@gmail.com> <20201111011456.7875-3-digetx@gmail.com> <20201111054541.hstqrlvtpwxxbv4m@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201111054541.hstqrlvtpwxxbv4m@vireshk-i7> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11-11-20, 11:15, Viresh Kumar wrote: > On 11-11-20, 04:14, Dmitry Osipenko wrote: > > The dev_pm_opp_get_opp_table() shouldn't be used by drivers, use > > dev_pm_opp_set_clkname() instead. > > > > Suggested-by: Viresh Kumar > > Signed-off-by: Dmitry Osipenko > > --- > > drivers/memory/tegra/tegra20-emc.c | 30 +++++++++++++++++++----------- > > 1 file changed, 19 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c > > index 5e10aa97809f..bb3f315c9587 100644 > > --- a/drivers/memory/tegra/tegra20-emc.c > > +++ b/drivers/memory/tegra/tegra20-emc.c > > @@ -902,7 +902,7 @@ static int tegra_emc_interconnect_init(struct tegra_emc *emc) > > > > static int tegra_emc_opp_table_init(struct tegra_emc *emc) > > { > > - struct opp_table *opp_table; > > + struct opp_table *reg_opp_table = NULL, *clk_opp_table; > > const char *rname = "core"; > > int err; > > > > @@ -917,19 +917,24 @@ static int tegra_emc_opp_table_init(struct tegra_emc *emc) > > } > > > > /* voltage scaling is optional */ > > - if (device_property_present(emc->dev, "core-supply")) > > - opp_table = dev_pm_opp_set_regulators(emc->dev, &rname, 1); > > - else > > - opp_table = dev_pm_opp_get_opp_table(emc->dev); > > + if (device_property_present(emc->dev, "core-supply")) { > > + reg_opp_table = dev_pm_opp_set_regulators(emc->dev, &rname, 1); > > + if (IS_ERR(reg_opp_table)) > > + return dev_err_probe(emc->dev, PTR_ERR(reg_opp_table), > > + "failed to set OPP regulator\n"); > > + } > > > > - if (IS_ERR(opp_table)) > > - return dev_err_probe(emc->dev, PTR_ERR(opp_table), > > - "failed to prepare OPP table\n"); > > + clk_opp_table = dev_pm_opp_set_clkname(emc->dev, NULL); > > + err = PTR_ERR_OR_ZERO(clk_opp_table); > > Don't check for NULL here. My bad. You aren't checking but just converting to err. Its fine. -- viresh