Commit b9fc2d20 authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Mark Brown

spi: dw: Move runtime PM enable/disable from common to platform driver part

After commit 1e695983 ("spi: dw: Add basic runtime PM support")
there is following warning from PCI enumerated DesignWare SPI controller
during probe:

	dw_spi_pci 0000:00:13.0: Unbalanced pm_runtime_enable!

Runtime PM is already enabled for PCI devices by the PCI core and doing
it again in common DW SPI code leads to unbalanced enable calls.

Fix this by moving the runtime PM enable/disable calls to the platform
driver part of the driver.

Cc: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20191018132131.31608-1-jarkko.nikula@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fed8d8c7
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
...@@ -193,6 +194,8 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) ...@@ -193,6 +194,8 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
goto out; goto out;
} }
pm_runtime_enable(&pdev->dev);
ret = dw_spi_add_host(&pdev->dev, dws); ret = dw_spi_add_host(&pdev->dev, dws);
if (ret) if (ret)
goto out; goto out;
...@@ -201,6 +204,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) ...@@ -201,6 +204,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
return 0; return 0;
out: out:
pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(dwsmmio->pclk); clk_disable_unprepare(dwsmmio->pclk);
out_clk: out_clk:
clk_disable_unprepare(dwsmmio->clk); clk_disable_unprepare(dwsmmio->clk);
...@@ -212,6 +216,7 @@ static int dw_spi_mmio_remove(struct platform_device *pdev) ...@@ -212,6 +216,7 @@ static int dw_spi_mmio_remove(struct platform_device *pdev)
struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev); struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev);
dw_spi_remove_host(&dwsmmio->dws); dw_spi_remove_host(&dwsmmio->dws);
pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(dwsmmio->pclk); clk_disable_unprepare(dwsmmio->pclk);
clk_disable_unprepare(dwsmmio->clk); clk_disable_unprepare(dwsmmio->clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment