OSDN Git Service

cnss2: Add an option to skip booting device during driver probe
authorYue Ma <yuem@codeaurora.org>
Thu, 27 Jul 2017 18:05:02 +0000 (11:05 -0700)
committerGerrit - the friendly Code Review server <code-review@localhost>
Sat, 29 Jul 2017 02:29:07 +0000 (19:29 -0700)
Add an option for the debug module parameter to skip device boot
during driver probe. This adds the flexibility to boot device
later after kernel boots.

Change-Id: Icd8a544149f3d6b0f4ca3e3f7e004d230c2469ab
CRs-fixed: 2059087
Signed-off-by: Yue Ma <yuem@codeaurora.org>
drivers/net/wireless/cnss2/main.c

index e114d0c..8838a13 100644 (file)
@@ -57,6 +57,7 @@ MODULE_PARM_DESC(enable_waltest, "Enable to handle firmware waltest");
 
 enum cnss_debug_quirks {
        LINK_DOWN_SELF_RECOVERY,
+       SKIP_DEVICE_BOOT,
 };
 
 unsigned long quirks;
@@ -2232,13 +2233,15 @@ static int cnss_probe(struct platform_device *plat_dev)
        if (ret)
                goto reset_ctx;
 
-       ret = cnss_power_on_device(plat_priv);
-       if (ret)
-               goto free_res;
+       if (!test_bit(SKIP_DEVICE_BOOT, &quirks)) {
+               ret = cnss_power_on_device(plat_priv);
+               if (ret)
+                       goto free_res;
 
-       ret = cnss_pci_init(plat_priv);
-       if (ret)
-               goto power_off;
+               ret = cnss_pci_init(plat_priv);
+               if (ret)
+                       goto power_off;
+       }
 
        ret = cnss_register_esoc(plat_priv);
        if (ret)
@@ -2291,9 +2294,11 @@ unreg_bus_scale:
 unreg_esoc:
        cnss_unregister_esoc(plat_priv);
 deinit_pci:
-       cnss_pci_deinit(plat_priv);
+       if (!test_bit(SKIP_DEVICE_BOOT, &quirks))
+               cnss_pci_deinit(plat_priv);
 power_off:
-       cnss_power_off_device(plat_priv);
+       if (!test_bit(SKIP_DEVICE_BOOT, &quirks))
+               cnss_power_off_device(plat_priv);
 free_res:
        cnss_put_resources(plat_priv);
 reset_ctx: