summaryrefslogtreecommitdiff
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorJoel Fernandes (Google) <joel@joelfernandes.org>2019-07-16 18:12:25 -0400
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-08-13 14:28:47 -0700
commitc2fa1e1bfa5b74558854a70b8afd797d43eb2743 (patch)
tree52c73a3ef018a42c30ea26c7ad9326d55d060fdb /drivers/base/core.c
parent7fd69b0ba48a2b2d8e5b4f0945b28d3839a7705a (diff)
downloadlwn-c2fa1e1bfa5b74558854a70b8afd797d43eb2743.tar.gz
lwn-c2fa1e1bfa5b74558854a70b8afd797d43eb2743.zip
driver/core: Convert to use built-in RCU list checking
This commit applies the consolidated hlist_for_each_entry_rcu() support for lockdep conditions. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 636058bbf48a..eede79630ceb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -68,6 +68,11 @@ void device_links_read_unlock(int idx)
{
srcu_read_unlock(&device_links_srcu, idx);
}
+
+int device_links_read_lock_held(void)
+{
+ return srcu_read_lock_held(&device_links_srcu);
+}
#else /* !CONFIG_SRCU */
static DECLARE_RWSEM(device_links_lock);
@@ -91,6 +96,13 @@ void device_links_read_unlock(int not_used)
{
up_read(&device_links_lock);
}
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+int device_links_read_lock_held(void)
+{
+ return lockdep_is_held(&device_links_lock);
+}
+#endif
#endif /* !CONFIG_SRCU */
/**