aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0018-Revert-Revert-hwspinlock-rcar-Remove-the-MFIS-clock-.patch
blob: 5520dc1d5f56407ceb85e807e1a1229d259cb3f1 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
From d50c16e7df2cd0fad5edc132948a117e9b589ec5 Mon Sep 17 00:00:00 2001
From: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
Date: Mon, 13 Nov 2017 11:59:53 +0900
Subject: [PATCH 18/23] Revert "Revert "hwspinlock: rcar: Remove the MFIS clock
 control""

This reverts commit 0f2e362bbfc3 ("Revert "hwspinlock: rcar: Remove
the MFIS clock control"")

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

diff --git a/drivers/hwspinlock/rcar_hwspinlock.c b/drivers/hwspinlock/rcar_hwspinlock.c
index 35ba8c1..e089d9a 100644
--- a/drivers/hwspinlock/rcar_hwspinlock.c
+++ b/drivers/hwspinlock/rcar_hwspinlock.c
@@ -1,7 +1,7 @@
 /*
  * rcar_hwspinlock.c
  *
- * Copyright (C) 2016 Renesas Electronics Corporation
+ * Copyright (C) 2016-2017 Renesas Electronics Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2
@@ -13,7 +13,6 @@
  * GNU General Public License for more details.
  */
 #include <linux/hwspinlock.h>
-#include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
@@ -60,16 +59,6 @@ static int rcar_hwspinlock_probe(struct platform_device *pdev)
 	struct hwspinlock_device	*bank;
 	struct hwspinlock		*lock;
 	struct resource			*res = NULL;
-	struct clk			*clock;
-
-	/* enable MFIS clock */
-	clock = of_clk_get(pdev->dev.of_node, 0);
-	if (!clock) {
-		dev_err(&pdev->dev, "Failed to get clock.\n");
-		ret = PTR_ERR(clock);
-		goto out;
-	}
-	clk_prepare_enable(clock);
 
 	pm_runtime_enable(&pdev->dev);
 
@@ -80,7 +69,7 @@ static int rcar_hwspinlock_probe(struct platform_device *pdev)
 	if (IS_ERR(addr)) {
 		dev_err(&pdev->dev, "Failed to remap MFIS Lock register.\n");
 		ret = PTR_ERR(addr);
-		goto clk_disable;
+		goto out;
 	}
 
 	/* create hwspinlock control info */
@@ -90,7 +79,7 @@ static int rcar_hwspinlock_probe(struct platform_device *pdev)
 	if (!bank) {
 		dev_err(&pdev->dev, "Failed to allocate memory.\n");
 		ret = PTR_ERR(bank);
-		goto clk_disable;
+		goto out;
 	}
 
 	for (idx = 0; idx < RCAR_HWSPINLOCK_NUM; idx++) {
@@ -102,12 +91,6 @@ static int rcar_hwspinlock_probe(struct platform_device *pdev)
 	/* register hwspinlock */
 	ret = hwspin_lock_register(bank, &pdev->dev, &rcar_hwspinlock_ops,
 				   0, RCAR_HWSPINLOCK_NUM);
-	if (!ret)
-		goto out;
-
-clk_disable:
-	if (clock)
-		clk_disable_unprepare(clock);
 
 out:
 	return ret;
@@ -116,7 +99,6 @@ static int rcar_hwspinlock_probe(struct platform_device *pdev)
 static int rcar_hwspinlock_remove(struct platform_device *pdev)
 {
 	int		ret;
-	struct clk	*clock = NULL;
 
 	ret = hwspin_lock_unregister(platform_get_drvdata(pdev));
 	if (ret) {
@@ -125,9 +107,6 @@ static int rcar_hwspinlock_remove(struct platform_device *pdev)
 	}
 
 	pm_runtime_disable(&pdev->dev);
-	clock = of_clk_get(pdev->dev.of_node, 0);
-	if (clock)
-		clk_disable_unprepare(clock);
 
 	return 0;
 }
-- 
1.9.1