staging: tidspbridge: remove io_init() and io_exit()
The io module has a io_init() and a io_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 <vjaquez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1471d6c69f
commit
b4aac487b0
|
@ -55,7 +55,6 @@ struct io_attrs {
|
||||||
* -EINVAL: Invalid DSP word size (must be > 0).
|
* -EINVAL: Invalid DSP word size (must be > 0).
|
||||||
* Invalid base address for DSP communications.
|
* Invalid base address for DSP communications.
|
||||||
* Requires:
|
* Requires:
|
||||||
* io_init(void) called.
|
|
||||||
* io_man != NULL.
|
* io_man != NULL.
|
||||||
* mgr_attrts != NULL.
|
* mgr_attrts != NULL.
|
||||||
* Ensures:
|
* Ensures:
|
||||||
|
@ -74,36 +73,8 @@ extern int io_create(struct io_mgr **io_man,
|
||||||
* 0: Success.
|
* 0: Success.
|
||||||
* -EFAULT: hio_mgr was invalid.
|
* -EFAULT: hio_mgr was invalid.
|
||||||
* Requires:
|
* Requires:
|
||||||
* io_init(void) called.
|
|
||||||
* Ensures:
|
* Ensures:
|
||||||
*/
|
*/
|
||||||
extern int io_destroy(struct io_mgr *hio_mgr);
|
extern int io_destroy(struct io_mgr *hio_mgr);
|
||||||
|
|
||||||
/*
|
|
||||||
* ======== io_exit ========
|
|
||||||
* Purpose:
|
|
||||||
* Discontinue usage of the IO module.
|
|
||||||
* Parameters:
|
|
||||||
* Returns:
|
|
||||||
* Requires:
|
|
||||||
* io_init(void) previously called.
|
|
||||||
* Ensures:
|
|
||||||
* Resources, if any acquired in io_init(void), are freed when the last
|
|
||||||
* client of IO calls io_exit(void).
|
|
||||||
*/
|
|
||||||
extern void io_exit(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ======== io_init ========
|
|
||||||
* Purpose:
|
|
||||||
* Initialize the IO module's private state.
|
|
||||||
* Parameters:
|
|
||||||
* Returns:
|
|
||||||
* TRUE if initialized; FALSE if error occurred.
|
|
||||||
* Requires:
|
|
||||||
* Ensures:
|
|
||||||
* A requirement for each of the other public CHNL functions.
|
|
||||||
*/
|
|
||||||
extern bool io_init(void);
|
|
||||||
|
|
||||||
#endif /* CHNL_ */
|
#endif /* CHNL_ */
|
||||||
|
|
|
@ -268,7 +268,6 @@ void api_exit(void)
|
||||||
if (api_c_refs == 0) {
|
if (api_c_refs == 0) {
|
||||||
/* Release all modules initialized in api_init(). */
|
/* Release all modules initialized in api_init(). */
|
||||||
dev_exit();
|
dev_exit();
|
||||||
io_exit();
|
|
||||||
mgr_exit();
|
mgr_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,24 +280,19 @@ void api_exit(void)
|
||||||
bool api_init(void)
|
bool api_init(void)
|
||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
bool fdev, fio;
|
bool fdev;
|
||||||
bool fmgr;
|
bool fmgr;
|
||||||
|
|
||||||
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();
|
||||||
fio = io_init();
|
|
||||||
fdev = dev_init();
|
fdev = dev_init();
|
||||||
ret = fdev && fio;
|
ret = fdev && fmgr;
|
||||||
ret = ret && fmgr;
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
|
|
||||||
if (fmgr)
|
if (fmgr)
|
||||||
mgr_exit();
|
mgr_exit();
|
||||||
|
|
||||||
if (fio)
|
|
||||||
io_exit();
|
|
||||||
|
|
||||||
if (fdev)
|
if (fdev)
|
||||||
dev_exit();
|
dev_exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,6 @@
|
||||||
#include <ioobj.h>
|
#include <ioobj.h>
|
||||||
#include <dspbridge/io.h>
|
#include <dspbridge/io.h>
|
||||||
|
|
||||||
/* ----------------------------------- Globals */
|
|
||||||
static u32 refs;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ======== io_create ========
|
* ======== io_create ========
|
||||||
* Purpose:
|
* Purpose:
|
||||||
|
@ -94,28 +91,3 @@ int io_destroy(struct io_mgr *hio_mgr)
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* ======== io_exit ========
|
|
||||||
* Purpose:
|
|
||||||
* Discontinue usage of the IO module.
|
|
||||||
*/
|
|
||||||
void io_exit(void)
|
|
||||||
{
|
|
||||||
refs--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ======== io_init ========
|
|
||||||
* Purpose:
|
|
||||||
* Initialize the IO module's private state.
|
|
||||||
*/
|
|
||||||
bool io_init(void)
|
|
||||||
{
|
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
if (ret)
|
|
||||||
refs++;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue