aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/ap_bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r--drivers/s390/crypto/ap_bus.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 2335be5f9bf7..a6aee68d2909 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -74,7 +74,7 @@ module_param_named(poll_thread, ap_thread_flag, int, 0000);
74MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 0 (off)."); 74MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 0 (off).");
75 75
76static struct device *ap_root_device = NULL; 76static struct device *ap_root_device = NULL;
77static DEFINE_SPINLOCK(ap_device_lock); 77static DEFINE_SPINLOCK(ap_device_list_lock);
78static LIST_HEAD(ap_device_list); 78static LIST_HEAD(ap_device_list);
79 79
80/* 80/*
@@ -518,16 +518,16 @@ static ssize_t ap_hwtype_show(struct device *dev,
518 struct ap_device *ap_dev = to_ap_dev(dev); 518 struct ap_device *ap_dev = to_ap_dev(dev);
519 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->device_type); 519 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->device_type);
520} 520}
521static DEVICE_ATTR(hwtype, 0444, ap_hwtype_show, NULL);
522 521
522static DEVICE_ATTR(hwtype, 0444, ap_hwtype_show, NULL);
523static ssize_t ap_depth_show(struct device *dev, struct device_attribute *attr, 523static ssize_t ap_depth_show(struct device *dev, struct device_attribute *attr,
524 char *buf) 524 char *buf)
525{ 525{
526 struct ap_device *ap_dev = to_ap_dev(dev); 526 struct ap_device *ap_dev = to_ap_dev(dev);
527 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->queue_depth); 527 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->queue_depth);
528} 528}
529static DEVICE_ATTR(depth, 0444, ap_depth_show, NULL);
530 529
530static DEVICE_ATTR(depth, 0444, ap_depth_show, NULL);
531static ssize_t ap_request_count_show(struct device *dev, 531static ssize_t ap_request_count_show(struct device *dev,
532 struct device_attribute *attr, 532 struct device_attribute *attr,
533 char *buf) 533 char *buf)
@@ -630,9 +630,9 @@ static int ap_device_probe(struct device *dev)
630 ap_dev->drv = ap_drv; 630 ap_dev->drv = ap_drv;
631 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; 631 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
632 if (!rc) { 632 if (!rc) {
633 spin_lock_bh(&ap_device_lock); 633 spin_lock_bh(&ap_device_list_lock);
634 list_add(&ap_dev->list, &ap_device_list); 634 list_add(&ap_dev->list, &ap_device_list);
635 spin_unlock_bh(&ap_device_lock); 635 spin_unlock_bh(&ap_device_list_lock);
636 } 636 }
637 return rc; 637 return rc;
638} 638}
@@ -674,9 +674,9 @@ static int ap_device_remove(struct device *dev)
674 674
675 ap_flush_queue(ap_dev); 675 ap_flush_queue(ap_dev);
676 del_timer_sync(&ap_dev->timeout); 676 del_timer_sync(&ap_dev->timeout);
677 spin_lock_bh(&ap_device_lock); 677 spin_lock_bh(&ap_device_list_lock);
678 list_del_init(&ap_dev->list); 678 list_del_init(&ap_dev->list);
679 spin_unlock_bh(&ap_device_lock); 679 spin_unlock_bh(&ap_device_list_lock);
680 if (ap_drv->remove) 680 if (ap_drv->remove)
681 ap_drv->remove(ap_dev); 681 ap_drv->remove(ap_dev);
682 spin_lock_bh(&ap_dev->lock); 682 spin_lock_bh(&ap_dev->lock);
@@ -1319,7 +1319,7 @@ static void ap_reset(struct ap_device *ap_dev)
1319 ap_dev->unregistered = 1; 1319 ap_dev->unregistered = 1;
1320} 1320}
1321 1321
1322static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags) 1322static int __ap_poll_device(struct ap_device *ap_dev, unsigned long *flags)
1323{ 1323{
1324 spin_lock(&ap_dev->lock); 1324 spin_lock(&ap_dev->lock);
1325 if (!ap_dev->unregistered) { 1325 if (!ap_dev->unregistered) {
@@ -1353,11 +1353,11 @@ static void ap_poll_all(unsigned long dummy)
1353 xchg((u8 *)ap_interrupt_indicator, 0); 1353 xchg((u8 *)ap_interrupt_indicator, 0);
1354 do { 1354 do {
1355 flags = 0; 1355 flags = 0;
1356 spin_lock(&ap_device_lock); 1356 spin_lock(&ap_device_list_lock);
1357 list_for_each_entry(ap_dev, &ap_device_list, list) { 1357 list_for_each_entry(ap_dev, &ap_device_list, list) {
1358 __ap_poll_all(ap_dev, &flags); 1358 __ap_poll_device(ap_dev, &flags);
1359 } 1359 }
1360 spin_unlock(&ap_device_lock); 1360 spin_unlock(&ap_device_list_lock);
1361 } while (flags & 1); 1361 } while (flags & 1);
1362 if (flags & 2) 1362 if (flags & 2)
1363 ap_schedule_poll_timer(); 1363 ap_schedule_poll_timer();
@@ -1397,11 +1397,11 @@ static int ap_poll_thread(void *data)
1397 remove_wait_queue(&ap_poll_wait, &wait); 1397 remove_wait_queue(&ap_poll_wait, &wait);
1398 1398
1399 flags = 0; 1399 flags = 0;
1400 spin_lock_bh(&ap_device_lock); 1400 spin_lock_bh(&ap_device_list_lock);
1401 list_for_each_entry(ap_dev, &ap_device_list, list) { 1401 list_for_each_entry(ap_dev, &ap_device_list, list) {
1402 __ap_poll_all(ap_dev, &flags); 1402 __ap_poll_device(ap_dev, &flags);
1403 } 1403 }
1404 spin_unlock_bh(&ap_device_lock); 1404 spin_unlock_bh(&ap_device_list_lock);
1405 } 1405 }
1406 set_current_state(TASK_RUNNING); 1406 set_current_state(TASK_RUNNING);
1407 remove_wait_queue(&ap_poll_wait, &wait); 1407 remove_wait_queue(&ap_poll_wait, &wait);