ret = t4_get_fw_version(adap, &adap->params.fw_vers);
+ /* Try multiple times before returning error */
+ for (i = 0; (ret == -EBUSY || ret == -EAGAIN) && i < 3; i++)
+ ret = t4_get_fw_version(adap, &adap->params.fw_vers);
+
if (ret)
return ret;
Nit: Just initalize ret to -EBUSY and change the test for i to < 4 rather than <
3. That way you will only have one call site for t4_get_fw_version, which I
think is more readable. Alternatively a do..while loop might be appropriate
here.
But I suppose I'm just splitting hairs at this point
Acked-by: Neil Horman <nhorman@tuxdriver.com>