c8738ccac870cb09b766db7a5860738937aa0610
[openwrt/openwrt.git] / target / linux / ipq806x / patches / 0134-spi-qup-Fix-order-of-spi_register_master.patch
1 From a7357be131e30fd1fb987b2cb343bc81db487f96 Mon Sep 17 00:00:00 2001
2 From: Andy Gross <agross@codeaurora.org>
3 Date: Thu, 12 Jun 2014 14:34:11 -0500
4 Subject: [PATCH 134/182] spi: qup: Fix order of spi_register_master
5
6 This patch moves the devm_spi_register_master below the initialization of the
7 runtime_pm. If done in the wrong order, the spi_register_master fails if any
8 probed slave devices issue SPI transactions.
9
10 Signed-off-by: Andy Gross <agross@codeaurora.org>
11 Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
12 ---
13 drivers/spi/spi-qup.c | 11 +++++++----
14 1 file changed, 7 insertions(+), 4 deletions(-)
15
16 diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
17 index dc128ac..a404298 100644
18 --- a/drivers/spi/spi-qup.c
19 +++ b/drivers/spi/spi-qup.c
20 @@ -619,16 +619,19 @@ static int spi_qup_probe(struct platform_device *pdev)
21 if (ret)
22 goto error;
23
24 - ret = devm_spi_register_master(dev, master);
25 - if (ret)
26 - goto error;
27 -
28 pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC);
29 pm_runtime_use_autosuspend(dev);
30 pm_runtime_set_active(dev);
31 pm_runtime_enable(dev);
32 +
33 + ret = devm_spi_register_master(dev, master);
34 + if (ret)
35 + goto disable_pm;
36 +
37 return 0;
38
39 +disable_pm:
40 + pm_runtime_disable(&pdev->dev);
41 error:
42 clk_disable_unprepare(cclk);
43 clk_disable_unprepare(iclk);
44 --
45 1.7.10.4
46