[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210101165507.19486-15-tiny.windzz@gmail.com>
Date: Fri, 1 Jan 2021 16:54:50 +0000
From: Yangtao Li <tiny.windzz@...il.com>
To: myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
cw00.choi@...sung.com, krzk@...nel.org, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
linux-imx@....com, digetx@...il.com, thierry.reding@...il.com,
jonathanh@...dia.com, yuq825@...il.com, airlied@...ux.ie,
daniel@...ll.ch, robdclark@...il.com, sean@...rly.run,
robh@...nel.org, tomeu.vizoso@...labora.com, steven.price@....com,
alyssa.rosenzweig@...labora.com, stanimir.varbanov@...aro.org,
agross@...nel.org, bjorn.andersson@...aro.org, mchehab@...nel.org,
lukasz.luba@....com, adrian.hunter@...el.com,
ulf.hansson@...aro.org, vireshk@...nel.org, nm@...com,
sboyd@...nel.org, broonie@...nel.org, gregkh@...uxfoundation.org,
jirislaby@...nel.org, rjw@...ysocki.net, jcrouse@...eaurora.org,
hoegsberg@...gle.com, eric@...olt.net, tzimmermann@...e.de,
marijn.suijten@...ainline.org, gustavoars@...nel.org,
emil.velikov@...labora.com, jonathan@...ek.ca,
akhilpo@...eaurora.org, smasetty@...eaurora.org,
airlied@...hat.com, masneyb@...tation.org, kalyan_t@...eaurora.org,
tanmay@...eaurora.org, tiny.windzz@...il.com,
ddavenport@...omium.org, jsanka@...eaurora.org,
rnayak@...eaurora.org, tongtiangen@...wei.com,
miaoqinglang@...wei.com, khsieh@...eaurora.org,
abhinavk@...eaurora.org, chandanu@...eaurora.org,
groeck@...omium.org, varar@...eaurora.org, mka@...omium.org,
harigovi@...eaurora.org, rikard.falkeborn@...il.com,
natechancellor@...il.com, georgi.djakov@...aro.org,
akashast@...eaurora.org, parashar@...eaurora.org,
dianders@...omium.org
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
dri-devel@...ts.freedesktop.org, lima@...ts.freedesktop.org,
linux-arm-msm@...r.kernel.org, freedreno@...ts.freedesktop.org,
linux-media@...r.kernel.org, linux-mmc@...r.kernel.org,
linux-spi@...r.kernel.org, linux-serial@...r.kernel.org
Subject: [PATCH 14/31] spi: spi-qcom-qspi: convert to use devm_pm_opp_* API
Use devm_pm_opp_* API to simplify code, and remove opp_table
from qcom_qspi.
Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
drivers/spi/spi-qcom-qspi.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c
index 915ae115d8c1..1a1ab153ff59 100644
--- a/drivers/spi/spi-qcom-qspi.c
+++ b/drivers/spi/spi-qcom-qspi.c
@@ -142,7 +142,6 @@ struct qcom_qspi {
struct clk_bulk_data *clks;
struct qspi_xfer xfer;
struct icc_path *icc_path_cpu_to_qspi;
- struct opp_table *opp_table;
unsigned long last_speed;
/* Lock to protect data accessed by IRQs */
spinlock_t lock;
@@ -459,6 +458,7 @@ static int qcom_qspi_probe(struct platform_device *pdev)
struct device *dev;
struct spi_master *master;
struct qcom_qspi *ctrl;
+ struct opp_table *opp_table;
dev = &pdev->dev;
@@ -531,13 +531,13 @@ static int qcom_qspi_probe(struct platform_device *pdev)
master->handle_err = qcom_qspi_handle_err;
master->auto_runtime_pm = true;
- ctrl->opp_table = dev_pm_opp_set_clkname(&pdev->dev, "core");
- if (IS_ERR(ctrl->opp_table))
- return PTR_ERR(ctrl->opp_table);
+ opp_table = devm_pm_opp_set_clkname(dev, "core");
+ if (IS_ERR(opp_table))
+ return PTR_ERR(opp_table);
/* OPP table is optional */
- ret = dev_pm_opp_of_add_table(&pdev->dev);
+ ret = devm_pm_opp_of_add_table(dev);
if (ret) {
- dev_pm_opp_put_clkname(ctrl->opp_table);
+ devm_pm_opp_put_clkname(dev, opp_table);
if (ret != -ENODEV) {
dev_err(&pdev->dev, "invalid OPP table in device tree\n");
return ret;
@@ -553,8 +553,6 @@ static int qcom_qspi_probe(struct platform_device *pdev)
return 0;
pm_runtime_disable(dev);
- dev_pm_opp_of_remove_table(&pdev->dev);
- dev_pm_opp_put_clkname(ctrl->opp_table);
return ret;
}
@@ -568,8 +566,6 @@ static int qcom_qspi_remove(struct platform_device *pdev)
spi_unregister_master(master);
pm_runtime_disable(&pdev->dev);
- dev_pm_opp_of_remove_table(&pdev->dev);
- dev_pm_opp_put_clkname(ctrl->opp_table);
return 0;
}
--
2.25.1
Powered by blists - more mailing lists