|
@@ -74,6 +74,7 @@ static struct device *ap_root_device = NULL;
|
|
static struct ap_config_info *ap_configuration;
|
|
static struct ap_config_info *ap_configuration;
|
|
static DEFINE_SPINLOCK(ap_device_list_lock);
|
|
static DEFINE_SPINLOCK(ap_device_list_lock);
|
|
static LIST_HEAD(ap_device_list);
|
|
static LIST_HEAD(ap_device_list);
|
|
|
|
+static bool initialised;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Workqueue timer for bus rescan.
|
|
* Workqueue timer for bus rescan.
|
|
@@ -1384,6 +1385,9 @@ int ap_driver_register(struct ap_driver *ap_drv, struct module *owner,
|
|
{
|
|
{
|
|
struct device_driver *drv = &ap_drv->driver;
|
|
struct device_driver *drv = &ap_drv->driver;
|
|
|
|
|
|
|
|
+ if (!initialised)
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
drv->bus = &ap_bus_type;
|
|
drv->bus = &ap_bus_type;
|
|
drv->probe = ap_device_probe;
|
|
drv->probe = ap_device_probe;
|
|
drv->remove = ap_device_remove;
|
|
drv->remove = ap_device_remove;
|
|
@@ -1808,6 +1812,7 @@ int __init ap_module_init(void)
|
|
goto out_pm;
|
|
goto out_pm;
|
|
|
|
|
|
queue_work(system_long_wq, &ap_scan_work);
|
|
queue_work(system_long_wq, &ap_scan_work);
|
|
|
|
+ initialised = true;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
@@ -1837,6 +1842,7 @@ void ap_module_exit(void)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ initialised = false;
|
|
ap_reset_domain();
|
|
ap_reset_domain();
|
|
ap_poll_thread_stop();
|
|
ap_poll_thread_stop();
|
|
del_timer_sync(&ap_config_timer);
|
|
del_timer_sync(&ap_config_timer);
|