[FPD LIB][PDK-5262][BOARD LIB]UB960 pattern generation API programs UB960 in case...
authorVivek Dhande <a0132295@ti.com>
Wed, 13 May 2020 10:52:35 +0000 (16:22 +0530)
committerSivaraj R <sivaraj@ti.com>
Fri, 15 May 2020 03:44:17 +0000 (22:44 -0500)
- bug fix
- Removed multiple returns from the function

Signed-off-by: Vivek Dhande <a0132295@ti.com>
packages/ti/board/src/devices/fpd/ds90ub960.c

index 75dbbcf4f8b713a76f273af4e7b95d054c266b77..da1a5eaf31773335e44a762f01b3741272e845cf 100755 (executable)
@@ -727,7 +727,7 @@ Board_STATUS Board_fpdUb960CfgPG(void *handle,
 {
     Board_STATUS ret = BOARD_SOK;
 
-    if((handle == NULL) && (pgType >= BOARD_FPD_UB960_PG_MAX))
+    if((handle == NULL) || (pgType >= BOARD_FPD_UB960_PG_MAX))
     {
         ret = BOARD_INVALID_PARAM;
     }
@@ -902,7 +902,8 @@ Board_STATUS Board_fpdUb960Cfg(void *handle,
                                      BOARD_I2C_TRANSACTION_TIMEOUT);
             if(ret != 0)
             {
-                return BOARD_I2C_TRANSFER_FAIL;
+                ret = BOARD_I2C_TRANSFER_FAIL;
+                break;
             }
 
             if(ub960Cfg[index].i2cDelay != 0)
@@ -917,7 +918,8 @@ Board_STATUS Board_fpdUb960Cfg(void *handle,
                                      BOARD_I2C_TRANSACTION_TIMEOUT);
             if(ret != 0)
             {
-                return BOARD_I2C_TRANSFER_FAIL;
+                ret = return BOARD_I2C_TRANSFER_FAIL;
+                break;
             }
 
             BOARD_DEVICES_STS_LOG(" --- read back data - 0x%2x\n\r", rdData);