Browse Source

qcacld-3.0: Return error code when any of bus register failed

Return error code when any of bus register functions failed.

Change-Id: I3cdc6afaa3899f1c32ab85fec5b89fa2e736d7b8
CRs-Fixed: 1023647
Yuanyuan Liu 8 years ago
parent
commit
1348108467
1 changed files with 6 additions and 5 deletions
  1. 6 5
      core/pld/src/pld_common.c

+ 6 - 5
core/pld/src/pld_common.c

@@ -48,6 +48,7 @@
 
 #define PLD_PCIE_REGISTERED BIT(0)
 #define PLD_SNOC_REGISTERED BIT(1)
+#define PLD_BUS_MASK 0x3
 
 static struct pld_context *pld_ctx;
 
@@ -157,7 +158,7 @@ enum pld_bus_type pld_get_bus_type(struct device *dev)
  * device is online.
  *
  * Return: 0 for success
- *         Non zero failure code for errors
+ *         pld_driver_state for errors
  */
 int pld_register_driver(struct pld_driver_ops *ops)
 {
@@ -192,10 +193,10 @@ int pld_register_driver(struct pld_driver_ops *ops)
 	if (0 == pld_snoc_register_driver())
 		pld_context->pld_driver_state |= PLD_SNOC_REGISTERED;
 
-	if (0 == pld_context->pld_driver_state) {
-		pr_err("All driver falied to register\n");
-		ret = -EINVAL;
-		goto out;
+	if ((PLD_BUS_MASK & pld_context->pld_driver_state) != PLD_BUS_MASK) {
+		pr_err("driver falied to register, state %x\n",
+		       pld_context->pld_driver_state);
+		ret = pld_context->pld_driver_state;
 	}
 
 out: