From: Viresh Kumar <viresh.kumar@linaro.org>
To: rnayak@codeaurora.org, Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Mark Brown <broonie@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Rafael Wysocki <rjw@rjwysocki.net>,
Stephen Boyd <sboyd@kernel.org>, Nishanth Menon <nm@ti.com>,
Douglas Anderson <dianders@chromium.org>,
Naresh Kamboju <naresh.kamboju@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH V2 6/8] spi: spi-qcom-qspi: Unconditionally call dev_pm_opp_of_remove_table()
Date: Fri, 28 Aug 2020 11:37:51 +0530 [thread overview]
Message-ID: <b77aa0bbe82a580508e321a34da488b4b27966d0.1598594714.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1598594714.git.viresh.kumar@linaro.org>
dev_pm_opp_of_remove_table() doesn't report any errors when it fails to
find the OPP table with error -ENODEV (i.e. OPP table not present for
the device). And we can call dev_pm_opp_of_remove_table()
unconditionally here.
While at it, create a new label and put clkname on errors.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V2:
- Compare with -ENODEV only for failures.
- Create new label to put clkname.
---
drivers/spi/spi-qcom-qspi.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c
index b8857a97f40a..e5829c56650b 100644
--- a/drivers/spi/spi-qcom-qspi.c
+++ b/drivers/spi/spi-qcom-qspi.c
@@ -143,7 +143,6 @@ struct qcom_qspi {
struct qspi_xfer xfer;
struct icc_path *icc_path_cpu_to_qspi;
struct opp_table *opp_table;
- bool has_opp_table;
unsigned long last_speed;
/* Lock to protect data accessed by IRQs */
spinlock_t lock;
@@ -546,11 +545,9 @@ static int qcom_qspi_probe(struct platform_device *pdev)
}
/* OPP table is optional */
ret = dev_pm_opp_of_add_table(&pdev->dev);
- if (!ret) {
- ctrl->has_opp_table = true;
- } else if (ret != -ENODEV) {
+ if (ret && ret != -ENODEV) {
dev_err(&pdev->dev, "invalid OPP table in device tree\n");
- goto exit_probe_master_put;
+ goto exit_probe_put_clkname;
}
pm_runtime_use_autosuspend(dev);
@@ -562,8 +559,9 @@ static int qcom_qspi_probe(struct platform_device *pdev)
return 0;
pm_runtime_disable(dev);
- if (ctrl->has_opp_table)
- dev_pm_opp_of_remove_table(&pdev->dev);
+ dev_pm_opp_of_remove_table(&pdev->dev);
+
+exit_probe_put_clkname:
dev_pm_opp_put_clkname(ctrl->opp_table);
exit_probe_master_put:
@@ -581,8 +579,7 @@ static int qcom_qspi_remove(struct platform_device *pdev)
spi_unregister_master(master);
pm_runtime_disable(&pdev->dev);
- if (ctrl->has_opp_table)
- dev_pm_opp_of_remove_table(&pdev->dev);
+ dev_pm_opp_of_remove_table(&pdev->dev);
dev_pm_opp_put_clkname(ctrl->opp_table);
return 0;
--
2.25.0.rc1.19.g042ed3e048af
next prev parent reply other threads:[~2020-08-28 6:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-28 6:07 [PATCH V2 0/8] opp: Unconditionally call dev_pm_opp_of_remove_table() Viresh Kumar
2020-08-28 6:07 ` [PATCH V2 1/8] cpufreq: imx6q: " Viresh Kumar
2020-08-28 6:07 ` [PATCH V2 2/8] drm/lima: " Viresh Kumar
2020-10-22 5:14 ` Viresh Kumar
2020-08-28 6:07 ` [PATCH V2 3/8] drm/msm: " Viresh Kumar
2020-09-01 7:31 ` Rajendra Nayak
2020-09-01 8:38 ` Viresh Kumar
2020-09-01 9:45 ` Rajendra Nayak
2020-09-01 9:50 ` Viresh Kumar
2020-10-05 6:26 ` Viresh Kumar
2020-10-21 7:24 ` Viresh Kumar
2020-10-21 16:58 ` Rob Clark
2020-10-22 5:12 ` Viresh Kumar
2020-08-28 6:07 ` [PATCH V2 4/8] mmc: sdhci-msm: " Viresh Kumar
2020-08-28 8:43 ` Ulf Hansson
2020-08-28 15:06 ` Doug Anderson
2020-08-31 6:23 ` Viresh Kumar
2020-08-31 10:44 ` Viresh Kumar
2020-08-31 10:57 ` Ulf Hansson
2020-09-09 11:07 ` Viresh Kumar
2020-09-09 12:48 ` Ulf Hansson
2020-08-28 6:07 ` [PATCH V2 5/8] spi: spi-geni-qcom: " Viresh Kumar
2020-08-28 6:07 ` Viresh Kumar [this message]
2020-08-28 6:07 ` [PATCH V2 7/8] tty: serial: qcom_geni_serial: " Viresh Kumar
2020-08-28 6:07 ` [PATCH V2 8/8] qcom-geni-se: remove has_opp_table Viresh Kumar
2020-10-21 7:34 ` Viresh Kumar
2020-10-21 15:31 ` Doug Anderson
2020-08-31 11:09 ` [PATCH V2 0/8] opp: Unconditionally call dev_pm_opp_of_remove_table() Viresh Kumar
2020-09-09 11:08 ` Viresh Kumar
2020-09-09 15:28 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b77aa0bbe82a580508e321a34da488b4b27966d0.1598594714.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=broonie@kernel.org \
--cc=dianders@chromium.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=nm@ti.com \
--cc=rjw@rjwysocki.net \
--cc=rnayak@codeaurora.org \
--cc=sboyd@kernel.org \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).