summaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/ap_bus.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2014-09-30 16:44:04 +0200
committerJames Morris <james.l.morris@oracle.com>2014-09-30 16:44:04 +0200
commit6c8ff877cdf13cd5287ed9d700cfb6cb70e2bfa1 (patch)
tree2ab49b7d19fb69cdae5b6be9e7ba44f6cf3d45ef /drivers/s390/crypto/ap_bus.c
parentMerge tag 'keys-next-20140922' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
parentLinux 3.16 (diff)
downloadlinux-6c8ff877cdf13cd5287ed9d700cfb6cb70e2bfa1.tar.xz
linux-6c8ff877cdf13cd5287ed9d700cfb6cb70e2bfa1.zip
Merge commit 'v3.16' into next
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r--drivers/s390/crypto/ap_bus.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 69ef4f8cfac8..4038437ff033 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -901,10 +901,15 @@ static int ap_device_probe(struct device *dev)
int rc;
ap_dev->drv = ap_drv;
+
+ spin_lock_bh(&ap_device_list_lock);
+ list_add(&ap_dev->list, &ap_device_list);
+ spin_unlock_bh(&ap_device_list_lock);
+
rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
- if (!rc) {
+ if (rc) {
spin_lock_bh(&ap_device_list_lock);
- list_add(&ap_dev->list, &ap_device_list);
+ list_del_init(&ap_dev->list);
spin_unlock_bh(&ap_device_list_lock);
}
return rc;