hdq_data->hdq_irqstatus, OMAP_HDQ_TIMEOUT);
if (ret == 0) {
dev_dbg(hdq_data->dev, "TX wait elapsed\n");
+ ret = -ETIMEDOUT;
goto out;
}
/* check irqstatus */
if (!(*status & OMAP_HDQ_INT_STATUS_TXCOMPLETE)) {
dev_dbg(hdq_data->dev, "timeout waiting for"
- "TXCOMPLETE/RXCOMPLETE, %x", *status);
+ " TXCOMPLETE/RXCOMPLETE, %x", *status);
ret = -ETIMEDOUT;
goto out;
}
OMAP_HDQ_FLAG_CLEAR, &tmp_status);
if (ret) {
dev_dbg(hdq_data->dev, "timeout waiting GO bit"
- "return to zero, %x", tmp_status);
+ " return to zero, %x", tmp_status);
}
out:
&tmp_status);
if (ret)
dev_dbg(hdq_data->dev, "timeout waiting INIT&GO bits"
- "return to zero, %x", tmp_status);
+ " return to zero, %x", tmp_status);
out:
mutex_unlock(&hdq_data->hdq_mutex);
/* check irqstatus */
if (!(status & OMAP_HDQ_INT_STATUS_RXCOMPLETE)) {
dev_dbg(hdq_data->dev, "timeout waiting for"
- "RXCOMPLETE, %x", status);
+ " RXCOMPLETE, %x", status);
ret = -ETIMEDOUT;
goto out;
}
out:
mutex_unlock(&hdq_data->hdq_mutex);
rtn:
- return 0;
+ return ret;
}
if (0 == hdq_data->hdq_usecount) {
dev_dbg(hdq_data->dev, "attempt to decrement use count"
- "when it is zero");
+ " when it is zero");
ret = -EINVAL;
} else {
hdq_data->hdq_usecount--;
mutex_unlock(&hdq_data->hdq_mutex);
ret = hdq_write_byte(hdq_data, byte, &status);
- if (ret == 0) {
+ if (ret < 0) {
dev_dbg(hdq_data->dev, "TX failure:Ctrl status %x\n", status);
return;
}