/* ----------------------------------- Function Prototypes */
static int delete_strm(struct strm_object *stream_obj);
-static void delete_strm_mgr(struct strm_mgr *strm_mgr_obj);
/*
* ======== strm_allocate_buffer ========
status =
(*intf_fxns->pfn_chnl_get_info) (stream_obj->chnl_obj,
&chnl_info_obj);
- DBC_ASSERT(DSP_SUCCEEDED(status));
+ DBC_ASSERT(!status);
if (chnl_info_obj.cio_cs > 0 || chnl_info_obj.cio_reqs > 0)
status = -EPIPE;
strm_mgr_obj->dev_obj = dev_obj;
/* Get Channel manager and Bridge function interface */
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
status = dev_get_chnl_mgr(dev_obj, &(strm_mgr_obj->hchnl_mgr));
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
(void)dev_get_intf_fxns(dev_obj,
&(strm_mgr_obj->intf_fxns));
DBC_ASSERT(strm_mgr_obj->intf_fxns != NULL);
}
}
- if (DSP_SUCCEEDED(status))
+ if (!status)
*strm_man = strm_mgr_obj;
else
- delete_strm_mgr(strm_mgr_obj);
+ kfree(strm_mgr_obj);
- DBC_ENSURE((DSP_SUCCEEDED(status) && *strm_man) ||
+ DBC_ENSURE((!status && *strm_man) ||
(DSP_FAILED(status) && *strm_man == NULL));
return status;
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(strm_mgr_obj);
- delete_strm_mgr(strm_mgr_obj);
+ kfree(strm_mgr_obj);
}
/*
if (!stream_obj)
status = -EFAULT;
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
for (i = 0; i < num_bufs; i++) {
DBC_ASSERT(stream_obj->xlator != NULL);
status =
status = -ESRCH;
}
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
status = (*intf_fxns->pfn_chnl_add_io_req)
(stream_obj->chnl_obj, pbuf, ul_bytes, ul_buf_size,
(u32) tmp_buf, dw_arg);
/* Get the channel id from the node (set in node_connect()) */
status = node_get_channel_id(hnode, dir, index, &ul_chnl_id);
}
- if (DSP_SUCCEEDED(status))
+ if (!status)
status = node_get_strm_mgr(hnode, &strm_mgr_obj);
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
strm_obj = kzalloc(sizeof(struct strm_object), GFP_KERNEL);
if (strm_obj == NULL) {
status = -ENOMEM;
DBC_ASSERT(strm_obj->strm_mode != STRMMODE_LDMA);
/* Get the shared mem mgr for this streams dev object */
status = dev_get_cmm_mgr(strm_mgr_obj->dev_obj, &hcmm_mgr);
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
/*Allocate a SM addr translator for this strm. */
status = cmm_xlator_create(&strm_obj->xlator, hcmm_mgr, NULL);
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
DBC_ASSERT(strm_obj->segment_id > 0);
/* Set translators Virt Addr attributes */
status = cmm_xlator_info(strm_obj->xlator,
}
}
func_cont:
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
/* Open channel */
chnl_mode = (dir == DSP_TONODE) ?
CHNL_MODETODSP : CHNL_MODEFROMDSP;
}
}
}
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
*strm_objct = strm_obj;
drv_proc_insert_strm_res_element(*strm_objct, &hstrm_res,
pr_ctxt);
}
/* ensure we return a documented error code */
- DBC_ENSURE((DSP_SUCCEEDED(status) && *strm_objct) ||
+ DBC_ENSURE((!status && *strm_objct) ||
(*strm_objct == NULL && (status == -EFAULT ||
status == -EPERM
|| status == -EINVAL)));
(*intf_fxns->pfn_chnl_get_ioc) (stream_obj->chnl_obj,
stream_obj->utimeout,
&chnl_ioc_obj);
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
*nbytes = chnl_ioc_obj.byte_size;
if (buff_size)
*buff_size = chnl_ioc_obj.buf_size;
}
}
/* Translate zerocopy buffer if channel not canceled. */
- if (DSP_SUCCEEDED(status)
+ if (!status
&& (!CHNL_IS_IO_CANCELLED(chnl_ioc_obj))
&& (stream_obj->strm_mode == STRMMODE_ZEROCOPY)) {
/*
}
func_end:
/* ensure we return a documented return code */
- DBC_ENSURE(DSP_SUCCEEDED(status) || status == -EFAULT ||
+ DBC_ENSURE(!status || status == -EFAULT ||
status == -ETIME || status == -ESRCH ||
status == -EPERM);
status = -ENOSYS;
}
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
intf_fxns = stream_obj->strm_mgr_obj->intf_fxns;
status =
hnotification);
}
/* ensure we return a documented return code */
- DBC_ENSURE(DSP_SUCCEEDED(status) || status == -EFAULT ||
+ DBC_ENSURE(!status || status == -EFAULT ||
status == -ETIME || status == -ESRCH ||
status == -ENOSYS || status == -EPERM);
return status;
}
}
- if (DSP_SUCCEEDED(status) && utimeout > 0 && *pmask == 0) {
+ if (!status && utimeout > 0 && *pmask == 0) {
/* Non-zero timeout */
sync_events = kmalloc(strms * sizeof(struct sync_object *),
GFP_KERNEL);
}
}
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
status =
sync_wait_on_multiple_events(sync_events, strms,
utimeout, &index);
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
/* Since we waited on the event, we have to
* reset it */
sync_set_event(sync_events[index]);
func_end:
kfree(sync_events);
- DBC_ENSURE((DSP_SUCCEEDED(status) && (*pmask != 0 || utimeout == 0)) ||
+ DBC_ENSURE((!status && (*pmask != 0 || utimeout == 0)) ||
(DSP_FAILED(status) && *pmask == 0));
return status;
status = (*intf_fxns->pfn_chnl_close)
(stream_obj->chnl_obj);
/* Free all SM address translator resources */
- if (DSP_SUCCEEDED(status)) {
+ if (!status) {
if (stream_obj->xlator) {
/* force free */
(void)cmm_xlator_delete(stream_obj->
}
return status;
}
-
-/*
- * ======== delete_strm_mgr ========
- * Purpose:
- * Frees stream manager.
- */
-static void delete_strm_mgr(struct strm_mgr *strm_mgr_obj)
-{
- if (strm_mgr_obj)
- kfree(strm_mgr_obj);
-}