aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/crypto/ccp/ccp-dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c
index 336e5b780fcb..4dbc18727235 100644
--- a/drivers/crypto/ccp/ccp-dev.c
+++ b/drivers/crypto/ccp/ccp-dev.c
@@ -53,7 +53,7 @@ static DEFINE_RWLOCK(ccp_unit_lock);
53static LIST_HEAD(ccp_units); 53static LIST_HEAD(ccp_units);
54 54
55/* Round-robin counter */ 55/* Round-robin counter */
56static DEFINE_RWLOCK(ccp_rr_lock); 56static DEFINE_SPINLOCK(ccp_rr_lock);
57static struct ccp_device *ccp_rr; 57static struct ccp_device *ccp_rr;
58 58
59/* Ever-increasing value to produce unique unit numbers */ 59/* Ever-increasing value to produce unique unit numbers */
@@ -128,14 +128,14 @@ static struct ccp_device *ccp_get_device(void)
128 */ 128 */
129 read_lock_irqsave(&ccp_unit_lock, flags); 129 read_lock_irqsave(&ccp_unit_lock, flags);
130 if (!list_empty(&ccp_units)) { 130 if (!list_empty(&ccp_units)) {
131 write_lock_irqsave(&ccp_rr_lock, flags); 131 spin_lock(&ccp_rr_lock);
132 dp = ccp_rr; 132 dp = ccp_rr;
133 if (list_is_last(&ccp_rr->entry, &ccp_units)) 133 if (list_is_last(&ccp_rr->entry, &ccp_units))
134 ccp_rr = list_first_entry(&ccp_units, struct ccp_device, 134 ccp_rr = list_first_entry(&ccp_units, struct ccp_device,
135 entry); 135 entry);
136 else 136 else
137 ccp_rr = list_next_entry(ccp_rr, entry); 137 ccp_rr = list_next_entry(ccp_rr, entry);
138 write_unlock_irqrestore(&ccp_rr_lock, flags); 138 spin_unlock(&ccp_rr_lock);
139 } 139 }
140 read_unlock_irqrestore(&ccp_unit_lock, flags); 140 read_unlock_irqrestore(&ccp_unit_lock, flags);
141 141