Commit 311abd9a authored by Víctor Manuel Jáquez Leal's avatar Víctor Manuel Jáquez Leal Committed by Greg Kroah-Hartman

staging: tidspbridge: remove strm_init() and strm_exit()

The strm module has a strm_init() and a strm_exit() whose only purpose
is to keep a reference counting which is not used at all.

This patch removes these functions and the reference count variable.

There is no functional changes.
Signed-off-by: default avatarVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2f69a43b
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
* -EPERM: Failure occurred, unable to allocate buffers. * -EPERM: Failure occurred, unable to allocate buffers.
* -EINVAL: usize must be > 0 bytes. * -EINVAL: usize must be > 0 bytes.
* Requires: * Requires:
* strm_init(void) called.
* ap_buffer != NULL. * ap_buffer != NULL.
* Ensures: * Ensures:
*/ */
...@@ -63,7 +62,6 @@ extern int strm_allocate_buffer(struct strm_res_object *strmres, ...@@ -63,7 +62,6 @@ extern int strm_allocate_buffer(struct strm_res_object *strmres,
* been reclaimed. * been reclaimed.
* -EPERM: Failure to close stream. * -EPERM: Failure to close stream.
* Requires: * Requires:
* strm_init(void) called.
* Ensures: * Ensures:
*/ */
extern int strm_close(struct strm_res_object *strmres, extern int strm_close(struct strm_res_object *strmres,
...@@ -83,7 +81,6 @@ extern int strm_close(struct strm_res_object *strmres, ...@@ -83,7 +81,6 @@ extern int strm_close(struct strm_res_object *strmres,
* -ENOMEM: Insufficient memory for requested resources. * -ENOMEM: Insufficient memory for requested resources.
* -EPERM: General failure. * -EPERM: General failure.
* Requires: * Requires:
* strm_init(void) called.
* strm_man != NULL. * strm_man != NULL.
* dev_obj != NULL. * dev_obj != NULL.
* Ensures: * Ensures:
...@@ -101,25 +98,12 @@ extern int strm_create(struct strm_mgr **strm_man, ...@@ -101,25 +98,12 @@ extern int strm_create(struct strm_mgr **strm_man,
* strm_mgr_obj: Handle to STRM manager object from strm_create. * strm_mgr_obj: Handle to STRM manager object from strm_create.
* Returns: * Returns:
* Requires: * Requires:
* strm_init(void) called.
* Valid strm_mgr_obj. * Valid strm_mgr_obj.
* Ensures: * Ensures:
* strm_mgr_obj is not valid. * strm_mgr_obj is not valid.
*/ */
extern void strm_delete(struct strm_mgr *strm_mgr_obj); extern void strm_delete(struct strm_mgr *strm_mgr_obj);
/*
* ======== strm_exit ========
* Purpose:
* Discontinue usage of STRM module.
* Parameters:
* Returns:
* Requires:
* strm_init(void) successfully called before.
* Ensures:
*/
extern void strm_exit(void);
/* /*
* ======== strm_free_buffer ======== * ======== strm_free_buffer ========
* Purpose: * Purpose:
...@@ -133,7 +117,6 @@ extern void strm_exit(void); ...@@ -133,7 +117,6 @@ extern void strm_exit(void);
* -EFAULT: Invalid stream handle. * -EFAULT: Invalid stream handle.
* -EPERM: Failure occurred, unable to free buffers. * -EPERM: Failure occurred, unable to free buffers.
* Requires: * Requires:
* strm_init(void) called.
* ap_buffer != NULL. * ap_buffer != NULL.
* Ensures: * Ensures:
*/ */
...@@ -156,7 +139,6 @@ extern int strm_free_buffer(struct strm_res_object *strmres, ...@@ -156,7 +139,6 @@ extern int strm_free_buffer(struct strm_res_object *strmres,
* -EINVAL: stream_info_size < sizeof(dsp_streaminfo). * -EINVAL: stream_info_size < sizeof(dsp_streaminfo).
* -EPERM: Unable to get stream info. * -EPERM: Unable to get stream info.
* Requires: * Requires:
* strm_init(void) called.
* stream_info != NULL. * stream_info != NULL.
* Ensures: * Ensures:
*/ */
...@@ -184,23 +166,10 @@ extern int strm_get_info(struct strm_object *stream_obj, ...@@ -184,23 +166,10 @@ extern int strm_get_info(struct strm_object *stream_obj,
* -ETIME: A timeout occurred before the stream could be idled. * -ETIME: A timeout occurred before the stream could be idled.
* -EPERM: Unable to idle stream. * -EPERM: Unable to idle stream.
* Requires: * Requires:
* strm_init(void) called.
* Ensures: * Ensures:
*/ */
extern int strm_idle(struct strm_object *stream_obj, bool flush_data); extern int strm_idle(struct strm_object *stream_obj, bool flush_data);
/*
* ======== strm_init ========
* Purpose:
* Initialize the STRM module.
* Parameters:
* Returns:
* TRUE if initialization succeeded, FALSE otherwise.
* Requires:
* Ensures:
*/
extern bool strm_init(void);
/* /*
* ======== strm_issue ======== * ======== strm_issue ========
* Purpose: * Purpose:
...@@ -217,8 +186,7 @@ extern bool strm_init(void); ...@@ -217,8 +186,7 @@ extern bool strm_init(void);
* -ENOSR: The stream is full. * -ENOSR: The stream is full.
* -EPERM: Failure occurred, unable to issue buffer. * -EPERM: Failure occurred, unable to issue buffer.
* Requires: * Requires:
* strm_init(void) called. * pbuf != NULL.
* pbuf != NULL.
* Ensures: * Ensures:
*/ */
extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf, extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf,
...@@ -244,7 +212,6 @@ extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf, ...@@ -244,7 +212,6 @@ extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf,
* Unable to open stream. * Unable to open stream.
* -EINVAL: Invalid index. * -EINVAL: Invalid index.
* Requires: * Requires:
* strm_init(void) called.
* strmres != NULL. * strmres != NULL.
* pattr != NULL. * pattr != NULL.
* Ensures: * Ensures:
...@@ -275,7 +242,6 @@ extern int strm_open(struct node_object *hnode, u32 dir, ...@@ -275,7 +242,6 @@ extern int strm_open(struct node_object *hnode, u32 dir,
* retrieved. * retrieved.
* -EPERM: Failure occurred, unable to reclaim buffer. * -EPERM: Failure occurred, unable to reclaim buffer.
* Requires: * Requires:
* strm_init(void) called.
* buf_ptr != NULL. * buf_ptr != NULL.
* nbytes != NULL. * nbytes != NULL.
* pdw_arg != NULL. * pdw_arg != NULL.
...@@ -302,7 +268,6 @@ extern int strm_reclaim(struct strm_object *stream_obj, ...@@ -302,7 +268,6 @@ extern int strm_reclaim(struct strm_object *stream_obj,
* -ENOSYS: Notification type specified by notify_type is not * -ENOSYS: Notification type specified by notify_type is not
* supported. * supported.
* Requires: * Requires:
* strm_init(void) called.
* hnotification != NULL. * hnotification != NULL.
* Ensures: * Ensures:
*/ */
...@@ -328,7 +293,6 @@ extern int strm_register_notify(struct strm_object *stream_obj, ...@@ -328,7 +293,6 @@ extern int strm_register_notify(struct strm_object *stream_obj,
* -ETIME: A timeout occurred before a stream became ready. * -ETIME: A timeout occurred before a stream became ready.
* -EPERM: Failure occurred, unable to select a stream. * -EPERM: Failure occurred, unable to select a stream.
* Requires: * Requires:
* strm_init(void) called.
* strm_tab != NULL. * strm_tab != NULL.
* strms > 0. * strms > 0.
* pmask != NULL. * pmask != NULL.
......
...@@ -271,7 +271,6 @@ void api_exit(void) ...@@ -271,7 +271,6 @@ void api_exit(void)
chnl_exit(); chnl_exit();
msg_exit(); msg_exit();
io_exit(); io_exit();
strm_exit();
mgr_exit(); mgr_exit();
rmm_exit(); rmm_exit();
} }
...@@ -286,12 +285,11 @@ bool api_init(void) ...@@ -286,12 +285,11 @@ bool api_init(void)
{ {
bool ret = true; bool ret = true;
bool fdev, fchnl, fmsg, fio; bool fdev, fchnl, fmsg, fio;
bool fmgr, fstrm, frmm; bool fmgr, frmm;
if (api_c_refs == 0) { if (api_c_refs == 0) {
/* initialize driver and other modules */ /* initialize driver and other modules */
fmgr = mgr_init(); fmgr = mgr_init();
fstrm = strm_init();
frmm = rmm_init(); frmm = rmm_init();
fchnl = chnl_init(); fchnl = chnl_init();
fmsg = msg_mod_init(); fmsg = msg_mod_init();
...@@ -304,9 +302,6 @@ bool api_init(void) ...@@ -304,9 +302,6 @@ bool api_init(void)
if (fmgr) if (fmgr)
mgr_exit(); mgr_exit();
if (fstrm)
strm_exit();
if (fchnl) if (fchnl)
chnl_exit(); chnl_exit();
......
...@@ -81,9 +81,6 @@ struct strm_object { ...@@ -81,9 +81,6 @@ struct strm_object {
struct cmm_xlatorobject *xlator; struct cmm_xlatorobject *xlator;
}; };
/* ----------------------------------- Globals */
static u32 refs; /* module reference count */
/* ----------------------------------- Function Prototypes */ /* ----------------------------------- Function Prototypes */
static int delete_strm(struct strm_object *stream_obj); static int delete_strm(struct strm_object *stream_obj);
...@@ -221,16 +218,6 @@ void strm_delete(struct strm_mgr *strm_mgr_obj) ...@@ -221,16 +218,6 @@ void strm_delete(struct strm_mgr *strm_mgr_obj)
kfree(strm_mgr_obj); kfree(strm_mgr_obj);
} }
/*
* ======== strm_exit ========
* Purpose:
* Discontinue usage of STRM module.
*/
void strm_exit(void)
{
refs--;
}
/* /*
* ======== strm_free_buffer ======== * ======== strm_free_buffer ========
* Purpose: * Purpose:
...@@ -349,21 +336,6 @@ int strm_idle(struct strm_object *stream_obj, bool flush_data) ...@@ -349,21 +336,6 @@ int strm_idle(struct strm_object *stream_obj, bool flush_data)
return status; return status;
} }
/*
* ======== strm_init ========
* Purpose:
* Initialize the STRM module.
*/
bool strm_init(void)
{
bool ret = true;
if (ret)
refs++;
return ret;
}
/* /*
* ======== strm_issue ======== * ======== strm_issue ========
* Purpose: * Purpose:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment