aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0019-Revert-Revert-hwspinlock-rcar-Add-pm_runtime_disable.patch
blob: 7c70c424ddfa434201536e071a0e2d54e0efb31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 6f3c87b79a086e94df4bb93bae56b13797ca7478 Mon Sep 17 00:00:00 2001
From: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
Date: Mon, 13 Nov 2017 12:00:51 +0900
Subject: [PATCH 19/23] Revert "Revert "hwspinlock: rcar: Add
 pm_runtime_disable if probe is failed.""

This reverts commit 9242bfb6e240 ("Revert "hwspinlock: rcar: Add
pm_runtime_disable if probe is failed."")

Signed-off-by: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
---
 drivers/hwspinlock/rcar_hwspinlock.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/hwspinlock/rcar_hwspinlock.c b/drivers/hwspinlock/rcar_hwspinlock.c
index e089d9a..b92db1b 100644
--- a/drivers/hwspinlock/rcar_hwspinlock.c
+++ b/drivers/hwspinlock/rcar_hwspinlock.c
@@ -60,8 +60,6 @@ static int rcar_hwspinlock_probe(struct platform_device *pdev)
 	struct hwspinlock		*lock;
 	struct resource			*res = NULL;
 
-	pm_runtime_enable(&pdev->dev);
-
 	/* map MFIS register */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	addr = (u32 __iomem *)devm_ioremap_nocache(&pdev->dev,
@@ -88,9 +86,13 @@ static int rcar_hwspinlock_probe(struct platform_device *pdev)
 	}
 	platform_set_drvdata(pdev, bank);
 
+	pm_runtime_enable(&pdev->dev);
+
 	/* register hwspinlock */
 	ret = hwspin_lock_register(bank, &pdev->dev, &rcar_hwspinlock_ops,
 				   0, RCAR_HWSPINLOCK_NUM);
+	if (ret)
+		pm_runtime_disable(&pdev->dev);
 
 out:
 	return ret;
-- 
1.9.1