]> git.baikalelectronics.ru Git - kernel.git/commitdiff
spi/hspi: fixup Runtime PM enable timing
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 3 Oct 2013 09:15:50 +0000 (02:15 -0700)
committerMark Brown <broonie@linaro.org>
Thu, 3 Oct 2013 13:08:06 +0000 (14:08 +0100)
2a8094768afbc1c90b7baf54b862d010a789580a
(spi/hspi: Convert to core runtime PM)
enabled master->auto_runtime_pm.
Then, pm_runtime_enable() is required *before*
spi_register_master() calling.
This patch fixed it up.
Kernel will hang up with "spi_master spi0: Failed to power device: -13"
message without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-sh-hspi.c

index 0b68cb592fa4d022bb6d3b3bc70296bcb224284b..e488a90a98b8acbfff5b1fd72dd92b54db2ae602 100644 (file)
@@ -296,6 +296,8 @@ static int hspi_probe(struct platform_device *pdev)
                goto error1;
        }
 
+       pm_runtime_enable(&pdev->dev);
+
        master->num_chipselect  = 1;
        master->bus_num         = pdev->id;
        master->setup           = hspi_setup;
@@ -309,8 +311,6 @@ static int hspi_probe(struct platform_device *pdev)
                goto error1;
        }
 
-       pm_runtime_enable(&pdev->dev);
-
        return 0;
 
  error1: