Skip to contentSkip to conversation

hwspinlock: ignore disabled device

PATCH In review Fabien Dessenne 3 participants 4 messages Mar 8, 2019 – Jun 29, 2019 Hardware spinlock core

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hwspinlock: ignore disabled device

Do not wait for hwspinlock device registration if it is not available for use.

---
V2: use 'goto out' instead of 'return'

 drivers/hwspinlock/hwspinlock_core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwspinlock/hwspinlock_core.c +5 -0
index 2bad40d..d806307 100644
@@ -333,6 +333,11 @@ int of_hwspin_lock_get_id(struct device_node *np, int index)
 	if (ret)
 		return ret;
 
+	if (!of_device_is_available(args.np)) {
+		ret = -ENOENT;
+		goto out;
+	}
+
 	/* Find the hwspinlock device: we need its base_id */
 	ret = -EPROBE_DEFER;
 	rcu_read_lock();
Signature · 1 line
2.7.4
#1 lore raw

Hi

Gentle reminder

Fabien

Quoted 26 lines · Fabien Dessenne

Do not wait for hwspinlock device registration if it is not available for use.

---
V2: use 'goto out' instead of 'return'

  drivers/hwspinlock/hwspinlock_core.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/hwspinlock/hwspinlock_core.c +5 -0
index 2bad40d..d806307 100644
@@ -333,6 +333,11 @@ int of_hwspin_lock_get_id(struct device_node *np, int index)
  	if (ret)
  		return ret;
 
+	if (!of_device_is_available(args.np)) {
+		ret = -ENOENT;
+		goto out;
+	}
+
  	/* Find the hwspinlock device: we need its base_id */
  	ret = -EPROBE_DEFER;
  	rcu_read_lock();
Acked-by on v2 1/1
#2 lore raw
In reply to Fabien Dessenne
Quoted 4 lines · Fabien Dessenne

Do not wait for hwspinlock device registration if it is not available for use.

Quoted 23 lines

---
V2: use 'goto out' instead of 'return'

 drivers/hwspinlock/hwspinlock_core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwspinlock/hwspinlock_core.c +5 -0
index 2bad40d..d806307 100644
@@ -333,6 +333,11 @@ int of_hwspin_lock_get_id(struct device_node *np, int index)
 	if (ret)
 		return ret;
 
+	if (!of_device_is_available(args.np)) {
+		ret = -ENOENT;
+		goto out;
+	}
+
 	/* Find the hwspinlock device: we need its base_id */
 	ret = -EPROBE_DEFER;
 	rcu_read_lock();
#3 lore raw
In reply to Fabien Dessenne
Quoted 4 lines · Fabien Dessenne

Do not wait for hwspinlock device registration if it is not available for use.

Applied with Suman's ack

Thanks,
Bjorn

Quoted 25 lines

---
V2: use 'goto out' instead of 'return'

 drivers/hwspinlock/hwspinlock_core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwspinlock/hwspinlock_core.c +5 -0
index 2bad40d..d806307 100644
@@ -333,6 +333,11 @@ int of_hwspin_lock_get_id(struct device_node *np, int index)
 	if (ret)
 		return ret;
 
+	if (!of_device_is_available(args.np)) {
+		ret = -ENOENT;
+		goto out;
+	}
+
 	/* Find the hwspinlock device: we need its base_id */
 	ret = -EPROBE_DEFER;
 	rcu_read_lock();
Signature · 1 line
2.7.4