From: Víctor Manuel Jáquez Leal Date: Fri, 9 Mar 2012 00:03:41 +0000 (+0100) Subject: staging: tidspbridge: remove strm_init() and strm_exit() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=311abd9ac44f72f4d10adaaf3af1c273b0f71db8;p=linux-beck.git 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: Víctor Manuel Jáquez Leal Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/tidspbridge/include/dspbridge/strm.h b/drivers/staging/tidspbridge/include/dspbridge/strm.h index 613fe53dd239..dacf0c234fd1 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/strm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/strm.h @@ -40,7 +40,6 @@ * -EPERM: Failure occurred, unable to allocate buffers. * -EINVAL: usize must be > 0 bytes. * Requires: - * strm_init(void) called. * ap_buffer != NULL. * Ensures: */ @@ -63,7 +62,6 @@ extern int strm_allocate_buffer(struct strm_res_object *strmres, * been reclaimed. * -EPERM: Failure to close stream. * Requires: - * strm_init(void) called. * Ensures: */ 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. * -EPERM: General failure. * Requires: - * strm_init(void) called. * strm_man != NULL. * dev_obj != NULL. * Ensures: @@ -101,25 +98,12 @@ extern int strm_create(struct strm_mgr **strm_man, * strm_mgr_obj: Handle to STRM manager object from strm_create. * Returns: * Requires: - * strm_init(void) called. * Valid strm_mgr_obj. * Ensures: * strm_mgr_obj is not valid. */ 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 ======== * Purpose: @@ -133,7 +117,6 @@ extern void strm_exit(void); * -EFAULT: Invalid stream handle. * -EPERM: Failure occurred, unable to free buffers. * Requires: - * strm_init(void) called. * ap_buffer != NULL. * Ensures: */ @@ -156,7 +139,6 @@ extern int strm_free_buffer(struct strm_res_object *strmres, * -EINVAL: stream_info_size < sizeof(dsp_streaminfo). * -EPERM: Unable to get stream info. * Requires: - * strm_init(void) called. * stream_info != NULL. * Ensures: */ @@ -184,23 +166,10 @@ extern int strm_get_info(struct strm_object *stream_obj, * -ETIME: A timeout occurred before the stream could be idled. * -EPERM: Unable to idle stream. * Requires: - * strm_init(void) called. * Ensures: */ 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 ======== * Purpose: @@ -217,8 +186,7 @@ extern bool strm_init(void); * -ENOSR: The stream is full. * -EPERM: Failure occurred, unable to issue buffer. * Requires: - * strm_init(void) called. - * pbuf != NULL. +* pbuf != NULL. * Ensures: */ 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. * -EINVAL: Invalid index. * Requires: - * strm_init(void) called. * strmres != NULL. * pattr != NULL. * Ensures: @@ -275,7 +242,6 @@ extern int strm_open(struct node_object *hnode, u32 dir, * retrieved. * -EPERM: Failure occurred, unable to reclaim buffer. * Requires: - * strm_init(void) called. * buf_ptr != NULL. * nbytes != NULL. * pdw_arg != NULL. @@ -302,7 +268,6 @@ extern int strm_reclaim(struct strm_object *stream_obj, * -ENOSYS: Notification type specified by notify_type is not * supported. * Requires: - * strm_init(void) called. * hnotification != NULL. * Ensures: */ @@ -328,7 +293,6 @@ extern int strm_register_notify(struct strm_object *stream_obj, * -ETIME: A timeout occurred before a stream became ready. * -EPERM: Failure occurred, unable to select a stream. * Requires: - * strm_init(void) called. * strm_tab != NULL. * strms > 0. * pmask != NULL. diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index b1a99f76694c..06e3b244f83f 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -271,7 +271,6 @@ void api_exit(void) chnl_exit(); msg_exit(); io_exit(); - strm_exit(); mgr_exit(); rmm_exit(); } @@ -286,12 +285,11 @@ bool api_init(void) { bool ret = true; bool fdev, fchnl, fmsg, fio; - bool fmgr, fstrm, frmm; + bool fmgr, frmm; if (api_c_refs == 0) { /* initialize driver and other modules */ fmgr = mgr_init(); - fstrm = strm_init(); frmm = rmm_init(); fchnl = chnl_init(); fmsg = msg_mod_init(); @@ -304,9 +302,6 @@ bool api_init(void) if (fmgr) mgr_exit(); - if (fstrm) - strm_exit(); - if (fchnl) chnl_exit(); diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index bd684f16baef..34cc934e0c3d 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -81,9 +81,6 @@ struct strm_object { struct cmm_xlatorobject *xlator; }; -/* ----------------------------------- Globals */ -static u32 refs; /* module reference count */ - /* ----------------------------------- Function Prototypes */ static int delete_strm(struct strm_object *stream_obj); @@ -221,16 +218,6 @@ void strm_delete(struct strm_mgr *strm_mgr_obj) kfree(strm_mgr_obj); } -/* - * ======== strm_exit ======== - * Purpose: - * Discontinue usage of STRM module. - */ -void strm_exit(void) -{ - refs--; -} - /* * ======== strm_free_buffer ======== * Purpose: @@ -349,21 +336,6 @@ int strm_idle(struct strm_object *stream_obj, bool flush_data) return status; } -/* - * ======== strm_init ======== - * Purpose: - * Initialize the STRM module. - */ -bool strm_init(void) -{ - bool ret = true; - - if (ret) - refs++; - - return ret; -} - /* * ======== strm_issue ======== * Purpose: