From 4b9dbe62c73c3f69ec70bb5c367a71e8ac14e295 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Fri, 14 Sep 2018 15:41:11 -0700 Subject: [PATCH] qcacld-3.0: move registration to end of driver load An upcoming change will add synchronization to the driver load operation. Effectively, driver load and psoc probe will need to be exclusive operations. Because driver registration can synchronously invoke psoc probe, move this registration to the end of the driver load function. This prepares the way for adding synchronization around the bulk of the load logic, and releasing it just before registration. This avoids issues where driver load and psoc probe would otherwise execute at the same time. Change-Id: I3a617673ea0d4a56e2c08b2ef2f98f8cbdf42205 CRs-Fixed: 2315976 --- core/hdd/src/wlan_hdd_main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index f5cc61511229..7d21a24634a0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -12731,24 +12731,24 @@ static int hdd_driver_load(void) hdd_set_conparam(con_mode); - errno = wlan_hdd_register_driver(); - if (errno) { - hdd_fln("Failed to register driver; errno:%d", errno); - goto wakelock_destroy; - } - errno = wlan_hdd_state_ctrl_param_create(); if (errno) { hdd_fln("Failed to create ctrl param; errno:%d", errno); - goto unregister_driver; + goto wakelock_destroy; + } + + errno = wlan_hdd_register_driver(); + if (errno) { + hdd_fln("Failed to register driver; errno:%d", errno); + goto param_destroy; } pr_info("%s: driver loaded\n", WLAN_MODULE_NAME); return 0; -unregister_driver: - wlan_hdd_unregister_driver(); +param_destroy: + wlan_hdd_state_ctrl_param_destroy(); wakelock_destroy: qdf_wake_lock_destroy(&wlan_wake_lock); comp_deinit: @@ -12788,8 +12788,8 @@ static void hdd_driver_unload(void) if (hdd_ctx) qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work); - wlan_hdd_state_ctrl_param_destroy(); wlan_hdd_unregister_driver(); + wlan_hdd_state_ctrl_param_destroy(); hdd_set_conparam(0); qdf_wake_lock_destroy(&wlan_wake_lock); hdd_component_deinit();