Skip to contentSkip to conversation

staging: atomisp: fix an issue timeout value for checking error

PATCH New Daeseok Youn 1 participant 1 message Mar 27, 2017

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: atomisp: fix an issue timeout value for checking error

The timeout variable could be zero even if the bits has expected result. The checking expected bits again would be better instead whether the timeout value is zero or not.

---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c +3 -3
index 94bc793..f2e5749 100644
@@ -220,11 +220,11 @@ static int write_target_freq_to_hw(struct atomisp_device *isp,
 			timeout--;
 		}
 
-		if (timeout != 0)
+		if (!(isp_sspm1 & ISP_FREQ_VALID_MASK))
 			break;
 	}
 
-	if (timeout = 0) {
+	if (isp_sspm1 & ISP_FREQ_VALID_MASK) {
 		dev_err(isp->dev, "DFS failed due to HW error.\n");
 		return -EINVAL;
 	}
@@ -238,7 +238,7 @@ static int write_target_freq_to_hw(struct atomisp_device *isp,
 		udelay(100);
 		timeout--;
 	}
-	if (timeout = 0) {
+	if ((isp_sspm1 >> ISP_FREQ_STAT_OFFSET) != ratio) {
 		dev_err(isp->dev, "DFS target freq is rejected by HW.\n");
 		return -EINVAL;
 	}
Signature · 1 line
1.9.1