diff options
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r-- | drivers/s390/crypto/ap_bus.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 9cb3dfbcaddb..61f768518a34 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -74,6 +74,7 @@ static struct device *ap_root_device = NULL; | |||
74 | static struct ap_config_info *ap_configuration; | 74 | static struct ap_config_info *ap_configuration; |
75 | static DEFINE_SPINLOCK(ap_device_list_lock); | 75 | static DEFINE_SPINLOCK(ap_device_list_lock); |
76 | static LIST_HEAD(ap_device_list); | 76 | static LIST_HEAD(ap_device_list); |
77 | static bool initialised; | ||
77 | 78 | ||
78 | /* | 79 | /* |
79 | * Workqueue timer for bus rescan. | 80 | * Workqueue timer for bus rescan. |
@@ -1384,6 +1385,9 @@ int ap_driver_register(struct ap_driver *ap_drv, struct module *owner, | |||
1384 | { | 1385 | { |
1385 | struct device_driver *drv = &ap_drv->driver; | 1386 | struct device_driver *drv = &ap_drv->driver; |
1386 | 1387 | ||
1388 | if (!initialised) | ||
1389 | return -ENODEV; | ||
1390 | |||
1387 | drv->bus = &ap_bus_type; | 1391 | drv->bus = &ap_bus_type; |
1388 | drv->probe = ap_device_probe; | 1392 | drv->probe = ap_device_probe; |
1389 | drv->remove = ap_device_remove; | 1393 | drv->remove = ap_device_remove; |
@@ -1808,6 +1812,7 @@ int __init ap_module_init(void) | |||
1808 | goto out_pm; | 1812 | goto out_pm; |
1809 | 1813 | ||
1810 | queue_work(system_long_wq, &ap_scan_work); | 1814 | queue_work(system_long_wq, &ap_scan_work); |
1815 | initialised = true; | ||
1811 | 1816 | ||
1812 | return 0; | 1817 | return 0; |
1813 | 1818 | ||
@@ -1837,6 +1842,7 @@ void ap_module_exit(void) | |||
1837 | { | 1842 | { |
1838 | int i; | 1843 | int i; |
1839 | 1844 | ||
1845 | initialised = false; | ||
1840 | ap_reset_domain(); | 1846 | ap_reset_domain(); |
1841 | ap_poll_thread_stop(); | 1847 | ap_poll_thread_stop(); |
1842 | del_timer_sync(&ap_config_timer); | 1848 | del_timer_sync(&ap_config_timer); |