Skip to content

Commit

Permalink
staging: tidspbridge: remove nldr_init() and nldr_exit()
Browse files Browse the repository at this point in the history
The dynamic loader was called by node.c with an interface. This interface was
also modified to avoid the use of nldr_init() and nldr_exit().

There is not functional changes.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Víctor Manuel Jáquez Leal authored and Greg Kroah-Hartman committed Mar 9, 2012
1 parent 81e8b88 commit 4d3bfdd
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 62 deletions.
2 changes: 0 additions & 2 deletions drivers/staging/tidspbridge/include/dspbridge/nldr.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ extern int nldr_create(struct nldr_object **nldr,
const struct nldr_attrs *pattrs);

extern void nldr_delete(struct nldr_object *nldr_obj);
extern void nldr_exit(void);

extern int nldr_get_fxn_addr(struct nldr_nodeobject *nldr_node_obj,
char *str_fxn, u32 * addr);

extern int nldr_get_rmm_manager(struct nldr_object *nldr,
struct rmm_target_obj **rmm_mgr);

extern bool nldr_init(void);
extern int nldr_load(struct nldr_nodeobject *nldr_node_obj,
enum nldr_phase phase);
extern int nldr_unload(struct nldr_nodeobject *nldr_node_obj,
Expand Down
34 changes: 0 additions & 34 deletions drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ enum nldr_phase {
* 0: Success.
* -ENOMEM: Insufficient memory on GPP.
* Requires:
* nldr_init(void) called.
* Valid nldr_obj.
* node_props != NULL.
* nldr_nodeobj != NULL.
Expand Down Expand Up @@ -148,7 +147,6 @@ typedef int(*nldr_allocatefxn) (struct nldr_object *nldr_obj,
* 0: Success;
* -ENOMEM: Insufficient memory for requested resources.
* Requires:
* nldr_init(void) called.
* nldr != NULL.
* hdev_obj != NULL.
* pattrs != NULL.
Expand All @@ -168,27 +166,12 @@ typedef int(*nldr_createfxn) (struct nldr_object **nldr,
* nldr_obj: Node manager object.
* Returns:
* Requires:
* nldr_init(void) called.
* Valid nldr_obj.
* Ensures:
* nldr_obj invalid
*/
typedef void (*nldr_deletefxn) (struct nldr_object *nldr_obj);

/*
* ======== nldr_exit ========
* Discontinue usage of NLDR module.
*
* Parameters:
* Returns:
* Requires:
* nldr_init(void) successfully called before.
* Ensures:
* Any resources acquired in nldr_init(void) will be freed when last NLDR
* client calls nldr_exit(void).
*/
typedef void (*nldr_exitfxn) (void);

/*
* ======== NLDR_Free ========
* Free resources allocated in nldr_allocate.
Expand All @@ -197,7 +180,6 @@ typedef void (*nldr_exitfxn) (void);
* nldr_node_obj: Handle returned from nldr_allocate().
* Returns:
* Requires:
* nldr_init(void) called.
* Valid nldr_node_obj.
* Ensures:
*/
Expand All @@ -216,7 +198,6 @@ typedef void (*nldr_freefxn) (struct nldr_nodeobject *nldr_node_obj);
* 0: Success.
* -ESPIPE: Address of function not found.
* Requires:
* nldr_init(void) called.
* Valid nldr_node_obj.
* addr != NULL;
* str_fxn != NULL;
Expand All @@ -226,17 +207,6 @@ typedef int(*nldr_getfxnaddrfxn) (struct nldr_nodeobject
* nldr_node_obj,
char *str_fxn, u32 * addr);

/*
* ======== nldr_init ========
* Initialize the NLDR module.
*
* Parameters:
* Returns:
* TRUE if initialization succeeded, FALSE otherwise.
* Ensures:
*/
typedef bool(*nldr_initfxn) (void);

/*
* ======== nldr_load ========
* Load create, delete, or execute phase function of a node on the DSP.
Expand All @@ -251,7 +221,6 @@ typedef bool(*nldr_initfxn) (void);
* is already in use.
* -EILSEQ: Failure in dynamic loader library.
* Requires:
* nldr_init(void) called.
* Valid nldr_node_obj.
* Ensures:
*/
Expand All @@ -269,7 +238,6 @@ typedef int(*nldr_loadfxn) (struct nldr_nodeobject *nldr_node_obj,
* 0: Success.
* -ENOMEM: Insufficient memory on GPP.
* Requires:
* nldr_init(void) called.
* Valid nldr_node_obj.
* Ensures:
*/
Expand All @@ -283,9 +251,7 @@ struct node_ldr_fxns {
nldr_allocatefxn allocate;
nldr_createfxn create;
nldr_deletefxn delete;
nldr_exitfxn exit;
nldr_getfxnaddrfxn get_fxn_addr;
nldr_initfxn init;
nldr_loadfxn load;
nldr_unloadfxn unload;
};
Expand Down
19 changes: 0 additions & 19 deletions drivers/staging/tidspbridge/rmgr/nldr.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,6 @@ void nldr_delete(struct nldr_object *nldr_obj)
kfree(nldr_obj);
}

/*
* ======== nldr_exit ========
* Discontinue usage of NLDR module.
*/
void nldr_exit(void)
{
/* do nothing */
}

/*
* ======== nldr_get_fxn_addr ========
*/
Expand Down Expand Up @@ -735,16 +726,6 @@ int nldr_get_rmm_manager(struct nldr_object *nldr,
return status;
}

/*
* ======== nldr_init ========
* Initialize the NLDR module.
*/
bool nldr_init(void)
{
/* do nothing */
return true;
}

/*
* ======== nldr_load ========
*/
Expand Down
7 changes: 0 additions & 7 deletions drivers/staging/tidspbridge/rmgr/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ struct node_mgr {
/* Loader properties */
struct nldr_object *nldr_obj; /* Handle to loader */
struct node_ldr_fxns nldr_fxns; /* Handle to loader functions */
bool loader_init; /* Loader Init function succeeded? */
};

/*
Expand Down Expand Up @@ -266,9 +265,7 @@ static struct node_ldr_fxns nldr_fxns = {
nldr_allocate,
nldr_create,
nldr_delete,
nldr_exit,
nldr_get_fxn_addr,
nldr_init,
nldr_load,
nldr_unload,
};
Expand Down Expand Up @@ -1337,7 +1334,6 @@ int node_create_mgr(struct node_mgr **node_man,
nldr_attrs_obj.write = mem_write;
nldr_attrs_obj.dsp_word_size = node_mgr_obj->dsp_word_size;
nldr_attrs_obj.dsp_mau_size = node_mgr_obj->dsp_mau_size;
node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.init();
status = node_mgr_obj->nldr_fxns.create(&node_mgr_obj->nldr_obj,
hdev_obj,
&nldr_attrs_obj);
Expand Down Expand Up @@ -2507,9 +2503,6 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr)
if (hnode_mgr->nldr_obj)
hnode_mgr->nldr_fxns.delete(hnode_mgr->nldr_obj);

if (hnode_mgr->loader_init)
hnode_mgr->nldr_fxns.exit();

kfree(hnode_mgr);
}
}
Expand Down

0 comments on commit 4d3bfdd

Please sign in to comment.