aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/w1/masters/omap_hdq.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 5ef385bfed18..3036b6113ffd 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -180,6 +180,7 @@ static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
180 hdq_data->hdq_irqstatus, OMAP_HDQ_TIMEOUT); 180 hdq_data->hdq_irqstatus, OMAP_HDQ_TIMEOUT);
181 if (ret == 0) { 181 if (ret == 0) {
182 dev_dbg(hdq_data->dev, "TX wait elapsed\n"); 182 dev_dbg(hdq_data->dev, "TX wait elapsed\n");
183 ret = -ETIMEDOUT;
183 goto out; 184 goto out;
184 } 185 }
185 186
@@ -187,7 +188,7 @@ static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
187 /* check irqstatus */ 188 /* check irqstatus */
188 if (!(*status & OMAP_HDQ_INT_STATUS_TXCOMPLETE)) { 189 if (!(*status & OMAP_HDQ_INT_STATUS_TXCOMPLETE)) {
189 dev_dbg(hdq_data->dev, "timeout waiting for" 190 dev_dbg(hdq_data->dev, "timeout waiting for"
190 "TXCOMPLETE/RXCOMPLETE, %x", *status); 191 " TXCOMPLETE/RXCOMPLETE, %x", *status);
191 ret = -ETIMEDOUT; 192 ret = -ETIMEDOUT;
192 goto out; 193 goto out;
193 } 194 }
@@ -198,7 +199,7 @@ static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
198 OMAP_HDQ_FLAG_CLEAR, &tmp_status); 199 OMAP_HDQ_FLAG_CLEAR, &tmp_status);
199 if (ret) { 200 if (ret) {
200 dev_dbg(hdq_data->dev, "timeout waiting GO bit" 201 dev_dbg(hdq_data->dev, "timeout waiting GO bit"
201 "return to zero, %x", tmp_status); 202 " return to zero, %x", tmp_status);
202 } 203 }
203 204
204out: 205out:
@@ -341,7 +342,7 @@ static int omap_hdq_break(struct hdq_data *hdq_data)
341 &tmp_status); 342 &tmp_status);
342 if (ret) 343 if (ret)
343 dev_dbg(hdq_data->dev, "timeout waiting INIT&GO bits" 344 dev_dbg(hdq_data->dev, "timeout waiting INIT&GO bits"
344 "return to zero, %x", tmp_status); 345 " return to zero, %x", tmp_status);
345 346
346out: 347out:
347 mutex_unlock(&hdq_data->hdq_mutex); 348 mutex_unlock(&hdq_data->hdq_mutex);
@@ -386,7 +387,7 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
386 /* check irqstatus */ 387 /* check irqstatus */
387 if (!(status & OMAP_HDQ_INT_STATUS_RXCOMPLETE)) { 388 if (!(status & OMAP_HDQ_INT_STATUS_RXCOMPLETE)) {
388 dev_dbg(hdq_data->dev, "timeout waiting for" 389 dev_dbg(hdq_data->dev, "timeout waiting for"
389 "RXCOMPLETE, %x", status); 390 " RXCOMPLETE, %x", status);
390 ret = -ETIMEDOUT; 391 ret = -ETIMEDOUT;
391 goto out; 392 goto out;
392 } 393 }
@@ -396,7 +397,7 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
396out: 397out:
397 mutex_unlock(&hdq_data->hdq_mutex); 398 mutex_unlock(&hdq_data->hdq_mutex);
398rtn: 399rtn:
399 return 0; 400 return ret;
400 401
401} 402}
402 403
@@ -470,7 +471,7 @@ static int omap_hdq_put(struct hdq_data *hdq_data)
470 471
471 if (0 == hdq_data->hdq_usecount) { 472 if (0 == hdq_data->hdq_usecount) {
472 dev_dbg(hdq_data->dev, "attempt to decrement use count" 473 dev_dbg(hdq_data->dev, "attempt to decrement use count"
473 "when it is zero"); 474 " when it is zero");
474 ret = -EINVAL; 475 ret = -EINVAL;
475 } else { 476 } else {
476 hdq_data->hdq_usecount--; 477 hdq_data->hdq_usecount--;
@@ -540,7 +541,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
540 mutex_unlock(&hdq_data->hdq_mutex); 541 mutex_unlock(&hdq_data->hdq_mutex);
541 542
542 ret = hdq_write_byte(hdq_data, byte, &status); 543 ret = hdq_write_byte(hdq_data, byte, &status);
543 if (ret == 0) { 544 if (ret < 0) {
544 dev_dbg(hdq_data->dev, "TX failure:Ctrl status %x\n", status); 545 dev_dbg(hdq_data->dev, "TX failure:Ctrl status %x\n", status);
545 return; 546 return;
546 } 547 }