[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200905204151.25343-6-digetx@gmail.com>
Date: Sat, 5 Sep 2020 23:41:25 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Wolfram Sang <wsa@...-dreams.de>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Andy Shevchenko <andy.shevchenko@...il.com>
Cc: linux-i2c@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v4 05/31] i2c: tegra: Runtime PM always available on Tegra
The runtime PM is guaranteed to be always available on Tegra after commit
40b2bb1b132a ("ARM: tegra: enforce PM requirement"). Hence let's remove
all the RPM-availability checking and handling from the code.
Reviewed-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Signed-off-by: Dmitry Osipenko <digetx@...il.com>
---
drivers/i2c/busses/i2c-tegra.c | 28 ++++++----------------------
1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index f5b9cdb65182..9f0269bffab4 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -1771,18 +1771,10 @@ static int tegra_i2c_probe(struct platform_device *pdev)
if (!i2c_dev->is_vi)
pm_runtime_irq_safe(&pdev->dev);
pm_runtime_enable(&pdev->dev);
- if (!pm_runtime_enabled(&pdev->dev)) {
- ret = tegra_i2c_runtime_resume(&pdev->dev);
- if (ret < 0) {
- dev_err(&pdev->dev, "runtime resume failed\n");
- goto unprepare_div_clk;
- }
- } else {
- ret = pm_runtime_get_sync(i2c_dev->dev);
- if (ret < 0) {
- dev_err(&pdev->dev, "runtime resume failed\n");
- goto disable_rpm;
- }
+ ret = pm_runtime_get_sync(i2c_dev->dev);
+ if (ret < 0) {
+ dev_err(dev, "runtime resume failed\n");
+ goto disable_rpm;
}
if (i2c_dev->is_multimaster_mode) {
@@ -1841,16 +1833,10 @@ static int tegra_i2c_probe(struct platform_device *pdev)
clk_disable(i2c_dev->div_clk);
put_rpm:
- if (pm_runtime_enabled(&pdev->dev))
- pm_runtime_put_sync(&pdev->dev);
- else
- tegra_i2c_runtime_suspend(&pdev->dev);
+ pm_runtime_put_sync(&pdev->dev);
disable_rpm:
- if (pm_runtime_enabled(&pdev->dev))
- pm_runtime_disable(&pdev->dev);
-
-unprepare_div_clk:
+ pm_runtime_disable(&pdev->dev);
clk_unprepare(i2c_dev->div_clk);
unprepare_slow_clk:
@@ -1872,8 +1858,6 @@ static int tegra_i2c_remove(struct platform_device *pdev)
clk_disable(i2c_dev->div_clk);
pm_runtime_disable(&pdev->dev);
- if (!pm_runtime_status_suspended(&pdev->dev))
- tegra_i2c_runtime_suspend(&pdev->dev);
clk_unprepare(i2c_dev->div_clk);
clk_unprepare(i2c_dev->slow_clk);
--
2.27.0
Powered by blists - more mailing lists