aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/tidspbridge/rmgr/disp.c
diff options
context:
space:
mode:
authorSapiens, Rene <rene.sapiens@ti.com>2010-11-03 20:31:24 -0400
committerOmar Ramirez Luna <omar.ramirez@ti.com>2011-02-04 21:11:11 -0500
commit98d0ba892536141ba047ecbe60b32e34c11834df (patch)
tree52501f4da509b2be5bb77d7f3e5eb2bae09c6b78 /drivers/staging/tidspbridge/rmgr/disp.c
parent4097c4968cd60bf5c690455466731d11149fe43f (diff)
staging: tidspbridge: overwrite DSP error codes
When calling the DSP's remote functions, the DSP returns error codes different from the ones managed by the kernel, the function's return value is shared with the MPU using a shared structure. This patch overwrites those error codes by kernel specifics and deletes unnecessary code. Signed-off-by: Rene Sapiens <rene.sapiens@ti.com> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Diffstat (limited to 'drivers/staging/tidspbridge/rmgr/disp.c')
-rw-r--r--drivers/staging/tidspbridge/rmgr/disp.c44
1 files changed, 8 insertions, 36 deletions
diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c
index b7ce4353e06..560069aade5 100644
--- a/drivers/staging/tidspbridge/rmgr/disp.c
+++ b/drivers/staging/tidspbridge/rmgr/disp.c
@@ -460,17 +460,6 @@ int disp_node_create(struct disp_object *disp_obj,
460 DBC_ASSERT(ul_bytes < (RMS_COMMANDBUFSIZE * sizeof(rms_word))); 460 DBC_ASSERT(ul_bytes < (RMS_COMMANDBUFSIZE * sizeof(rms_word)));
461 status = send_message(disp_obj, node_get_timeout(hnode), 461 status = send_message(disp_obj, node_get_timeout(hnode),
462 ul_bytes, node_env); 462 ul_bytes, node_env);
463 if (status >= 0) {
464 /*
465 * Message successfully received from RMS.
466 * Return the status of the Node's create function
467 * on the DSP-side
468 */
469 status = (((rms_word *) (disp_obj->pbuf))[0]);
470 if (status < 0)
471 dev_dbg(bridge, "%s: DSP-side failed: 0x%x\n",
472 __func__, status);
473 }
474 } 463 }
475func_end: 464func_end:
476 return status; 465 return status;
@@ -513,18 +502,6 @@ int disp_node_delete(struct disp_object *disp_obj,
513 status = send_message(disp_obj, node_get_timeout(hnode), 502 status = send_message(disp_obj, node_get_timeout(hnode),
514 sizeof(struct rms_command), 503 sizeof(struct rms_command),
515 &dw_arg); 504 &dw_arg);
516 if (status >= 0) {
517 /*
518 * Message successfully received from RMS.
519 * Return the status of the Node's delete
520 * function on the DSP-side
521 */
522 status = (((rms_word *) (disp_obj->pbuf))[0]);
523 if (status < 0)
524 dev_dbg(bridge, "%s: DSP-side failed: "
525 "0x%x\n", __func__, status);
526 }
527
528 } 505 }
529 } 506 }
530 return status; 507 return status;
@@ -566,18 +543,6 @@ int disp_node_run(struct disp_object *disp_obj,
566 status = send_message(disp_obj, node_get_timeout(hnode), 543 status = send_message(disp_obj, node_get_timeout(hnode),
567 sizeof(struct rms_command), 544 sizeof(struct rms_command),
568 &dw_arg); 545 &dw_arg);
569 if (status >= 0) {
570 /*
571 * Message successfully received from RMS.
572 * Return the status of the Node's execute
573 * function on the DSP-side
574 */
575 status = (((rms_word *) (disp_obj->pbuf))[0]);
576 if (status < 0)
577 dev_dbg(bridge, "%s: DSP-side failed: "
578 "0x%x\n", __func__, status);
579 }
580
581 } 546 }
582 } 547 }
583 548
@@ -739,7 +704,14 @@ static int send_message(struct disp_object *disp_obj, u32 timeout,
739 } else { 704 } else {
740 if (CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) { 705 if (CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) {
741 DBC_ASSERT(chnl_ioc_obj.pbuf == pbuf); 706 DBC_ASSERT(chnl_ioc_obj.pbuf == pbuf);
742 status = (*((rms_word *) chnl_ioc_obj.pbuf)); 707 if (*((int *)chnl_ioc_obj.pbuf) < 0) {
708 /* Translate DSP's to kernel error */
709 status = -EREMOTEIO;
710 dev_dbg(bridge, "%s: DSP-side failed:"
711 " DSP errcode = 0x%x, Kernel "
712 "errcode = %d\n", __func__,
713 *(int *)pbuf, status);
714 }
743 *pdw_arg = 715 *pdw_arg =
744 (((rms_word *) (chnl_ioc_obj.pbuf))[1]); 716 (((rms_word *) (chnl_ioc_obj.pbuf))[1]);
745 } else { 717 } else {