Commit 476a7eeb authored by Shinya Kuribayashi's avatar Shinya Kuribayashi Committed by Ohad Ben-Cohen

hwspinlock/core: use global ID to register hwspinlocks on multiple devices

Commit 300bab97 (hwspinlock/core: register a bank of hwspinlocks in a
single API call, 2011-09-06) introduced 'hwspin_lock_register_single()'
to register numerous (a bank of) hwspinlock instances in a single API,

At which time, 'hwspin_lock_register()' accidentally passes 'local IDs'
to 'hwspin_lock_register_single()', despite that ..._single() requires
'global IDs' to register hwspinlocks.

We have to convert into global IDs by supplying the missing 'base_id'.

Cc: stable <>
Signed-off-by: default avatarShinya Kuribayashi <>
[ohad: fix error path of hwspin_lock_register, too]
Signed-off-by: default avatarOhad Ben-Cohen <>
parent 6887a413
......@@ -345,7 +345,7 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
hwlock->bank = bank;
ret = hwspin_lock_register_single(hwlock, i);
ret = hwspin_lock_register_single(hwlock, base_id + i);
if (ret)
goto reg_failed;
......@@ -354,7 +354,7 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
while (--i >= 0)
hwspin_lock_unregister_single(base_id + i);
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment