From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.3 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_SANE_1 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 22BBFC388F9 for ; Wed, 11 Nov 2020 05:54:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2DFD2075A for ; Wed, 11 Nov 2020 05:54:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="X8GTCLnV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725973AbgKKFyF (ORCPT ); Wed, 11 Nov 2020 00:54:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgKKFyF (ORCPT ); Wed, 11 Nov 2020 00:54:05 -0500 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F1DBC0613D1 for ; Tue, 10 Nov 2020 21:54:03 -0800 (PST) Received: by mail-pf1-x444.google.com with SMTP id z3so939923pfb.10 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=SKp8zFhs46SSOA6V20wHSD2SyoNWJELw5zHTY6oMbF4LTmPMEBkUgVONtEwWAApCB+ dFAmJIoGrlFITHhEgHys202bqJeu5RfFjQHmABaAkk7ve6sTdXnSlGmhwAbSPhICX5Q8 1iikDF4Qr3zF2iEl0r52D+I4XQGzUARKtF0DaCWWiyr5wfeSyA7kkeNdvk/bNaBiQplh g/eogzuAZDMctQGLVXuhewBYm0/Ygywe16bnHmTmR+/gUTywvWOyXLXiBpo6zLlXYump 2XIl8XeQjGjyGpZfdQY+V6oV/STp11zfnTCEpgz6oA0/5hd4Yl0yQS1QFp4kkT/asFHx yrRw== X-Gm-Message-State: AOAM5326ONcXMI/NLpUkZi4y8E6iF8szUZogpHwZMWr2ZAMsdtMxDfp+ 2RGYy7NdXCagNsbUBbHmlRztrQ== X-Google-Smtp-Source: ABdhPJzCesDnaFKRgNtLIoN64pjuJ7aVVMAE9U+58KC8+aSCcNQm9J/waPMH5YmalfzWdRrq03fmZw== 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-tegra@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 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 8A8F5C388F9 for ; Wed, 11 Nov 2020 07:55:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BA1D206B5 for ; Wed, 11 Nov 2020 07:55:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="X8GTCLnV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BA1D206B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B684389F2E; Wed, 11 Nov 2020 07:54:48 +0000 (UTC) Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FEC089AB6 for ; Wed, 11 Nov 2020 05:54:03 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id i7so759736pgh.6 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=f2yf6dwHMpbzaX+ANWYB32xiBZStWEh7wDD0bDdNExOXVAth38QlNi17hzH89rubVi 3ekxuY8WTPUre8grl//LJ+9xvkBgaVk5nFL+yBMt/h0CbVMA8QdgFn0rKR/T5tk5piDz jBUazjMWUmZeVUoBh38biYF5TeO7Eu/oLp19d95GGqcDMSbk5y3i5T9f89k808hhknCG GO2edCstrjf60giUmEnZ4yAh7NlmfD9YCSl8DMoY9judwedTeZfs2eHce8VYRHllN11S un7pwE3HVVEMn7ovZO2EEUfr80o8MatIPAO1UoncE+KTvp7Ablv6tJc2KNJJEF7S421+ dL9w== X-Gm-Message-State: AOAM531+3tB+28Usw5KMxShp1XUDS27lphDADBzM8dWOak5r+KtSgpMh 83f5QgYnVzqcA4QHv3pHn6GIRQ== X-Google-Smtp-Source: ABdhPJzCesDnaFKRgNtLIoN64pjuJ7aVVMAE9U+58KC8+aSCcNQm9J/waPMH5YmalfzWdRrq03fmZw== 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 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-Disposition: inline In-Reply-To: <20201111054541.hstqrlvtpwxxbv4m@vireshk-i7> User-Agent: NeoMutt/20180716-391-311a52 X-Mailman-Approved-At: Wed, 11 Nov 2020 07:54:43 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter De Schrijver , Krzysztof Kozlowski , Mikko Perttunen , dri-devel@lists.freedesktop.org, Nicolas Chauvet , Stephen Boyd , Viresh Kumar , Michael Turquette , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jonathan Hunter , Chanwoo Choi , Kyungmin Park , Thierry Reding , MyungJoo Ham , Peter Geis , linux-tegra@vger.kernel.org, Georgi Djakov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel