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

staging: tidspbridge: remove nldr_init() and nldr_exit()

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: default avatarVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 81e8b88a
...@@ -36,7 +36,6 @@ extern int nldr_create(struct nldr_object **nldr, ...@@ -36,7 +36,6 @@ extern int nldr_create(struct nldr_object **nldr,
const struct nldr_attrs *pattrs); const struct nldr_attrs *pattrs);
extern void nldr_delete(struct nldr_object *nldr_obj); 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, extern int nldr_get_fxn_addr(struct nldr_nodeobject *nldr_node_obj,
char *str_fxn, u32 * addr); char *str_fxn, u32 * addr);
...@@ -44,7 +43,6 @@ extern int nldr_get_fxn_addr(struct nldr_nodeobject *nldr_node_obj, ...@@ -44,7 +43,6 @@ extern int nldr_get_fxn_addr(struct nldr_nodeobject *nldr_node_obj,
extern int nldr_get_rmm_manager(struct nldr_object *nldr, extern int nldr_get_rmm_manager(struct nldr_object *nldr,
struct rmm_target_obj **rmm_mgr); struct rmm_target_obj **rmm_mgr);
extern bool nldr_init(void);
extern int nldr_load(struct nldr_nodeobject *nldr_node_obj, extern int nldr_load(struct nldr_nodeobject *nldr_node_obj,
enum nldr_phase phase); enum nldr_phase phase);
extern int nldr_unload(struct nldr_nodeobject *nldr_node_obj, extern int nldr_unload(struct nldr_nodeobject *nldr_node_obj,
......
...@@ -119,7 +119,6 @@ enum nldr_phase { ...@@ -119,7 +119,6 @@ enum nldr_phase {
* 0: Success. * 0: Success.
* -ENOMEM: Insufficient memory on GPP. * -ENOMEM: Insufficient memory on GPP.
* Requires: * Requires:
* nldr_init(void) called.
* Valid nldr_obj. * Valid nldr_obj.
* node_props != NULL. * node_props != NULL.
* nldr_nodeobj != NULL. * nldr_nodeobj != NULL.
...@@ -148,7 +147,6 @@ typedef int(*nldr_allocatefxn) (struct nldr_object *nldr_obj, ...@@ -148,7 +147,6 @@ typedef int(*nldr_allocatefxn) (struct nldr_object *nldr_obj,
* 0: Success; * 0: Success;
* -ENOMEM: Insufficient memory for requested resources. * -ENOMEM: Insufficient memory for requested resources.
* Requires: * Requires:
* nldr_init(void) called.
* nldr != NULL. * nldr != NULL.
* hdev_obj != NULL. * hdev_obj != NULL.
* pattrs != NULL. * pattrs != NULL.
...@@ -168,27 +166,12 @@ typedef int(*nldr_createfxn) (struct nldr_object **nldr, ...@@ -168,27 +166,12 @@ typedef int(*nldr_createfxn) (struct nldr_object **nldr,
* nldr_obj: Node manager object. * nldr_obj: Node manager object.
* Returns: * Returns:
* Requires: * Requires:
* nldr_init(void) called.
* Valid nldr_obj. * Valid nldr_obj.
* Ensures: * Ensures:
* nldr_obj invalid * nldr_obj invalid
*/ */
typedef void (*nldr_deletefxn) (struct nldr_object *nldr_obj); 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 ======== * ======== NLDR_Free ========
* Free resources allocated in nldr_allocate. * Free resources allocated in nldr_allocate.
...@@ -197,7 +180,6 @@ typedef void (*nldr_exitfxn) (void); ...@@ -197,7 +180,6 @@ typedef void (*nldr_exitfxn) (void);
* nldr_node_obj: Handle returned from nldr_allocate(). * nldr_node_obj: Handle returned from nldr_allocate().
* Returns: * Returns:
* Requires: * Requires:
* nldr_init(void) called.
* Valid nldr_node_obj. * Valid nldr_node_obj.
* Ensures: * Ensures:
*/ */
...@@ -216,7 +198,6 @@ typedef void (*nldr_freefxn) (struct nldr_nodeobject *nldr_node_obj); ...@@ -216,7 +198,6 @@ typedef void (*nldr_freefxn) (struct nldr_nodeobject *nldr_node_obj);
* 0: Success. * 0: Success.
* -ESPIPE: Address of function not found. * -ESPIPE: Address of function not found.
* Requires: * Requires:
* nldr_init(void) called.
* Valid nldr_node_obj. * Valid nldr_node_obj.
* addr != NULL; * addr != NULL;
* str_fxn != NULL; * str_fxn != NULL;
...@@ -226,17 +207,6 @@ typedef int(*nldr_getfxnaddrfxn) (struct nldr_nodeobject ...@@ -226,17 +207,6 @@ typedef int(*nldr_getfxnaddrfxn) (struct nldr_nodeobject
* nldr_node_obj, * nldr_node_obj,
char *str_fxn, u32 * addr); 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 ======== * ======== nldr_load ========
* Load create, delete, or execute phase function of a node on the DSP. * Load create, delete, or execute phase function of a node on the DSP.
...@@ -251,7 +221,6 @@ typedef bool(*nldr_initfxn) (void); ...@@ -251,7 +221,6 @@ typedef bool(*nldr_initfxn) (void);
* is already in use. * is already in use.
* -EILSEQ: Failure in dynamic loader library. * -EILSEQ: Failure in dynamic loader library.
* Requires: * Requires:
* nldr_init(void) called.
* Valid nldr_node_obj. * Valid nldr_node_obj.
* Ensures: * Ensures:
*/ */
...@@ -269,7 +238,6 @@ typedef int(*nldr_loadfxn) (struct nldr_nodeobject *nldr_node_obj, ...@@ -269,7 +238,6 @@ typedef int(*nldr_loadfxn) (struct nldr_nodeobject *nldr_node_obj,
* 0: Success. * 0: Success.
* -ENOMEM: Insufficient memory on GPP. * -ENOMEM: Insufficient memory on GPP.
* Requires: * Requires:
* nldr_init(void) called.
* Valid nldr_node_obj. * Valid nldr_node_obj.
* Ensures: * Ensures:
*/ */
...@@ -283,9 +251,7 @@ struct node_ldr_fxns { ...@@ -283,9 +251,7 @@ struct node_ldr_fxns {
nldr_allocatefxn allocate; nldr_allocatefxn allocate;
nldr_createfxn create; nldr_createfxn create;
nldr_deletefxn delete; nldr_deletefxn delete;
nldr_exitfxn exit;
nldr_getfxnaddrfxn get_fxn_addr; nldr_getfxnaddrfxn get_fxn_addr;
nldr_initfxn init;
nldr_loadfxn load; nldr_loadfxn load;
nldr_unloadfxn unload; nldr_unloadfxn unload;
}; };
......
...@@ -619,15 +619,6 @@ void nldr_delete(struct nldr_object *nldr_obj) ...@@ -619,15 +619,6 @@ void nldr_delete(struct nldr_object *nldr_obj)
kfree(nldr_obj); kfree(nldr_obj);
} }
/*
* ======== nldr_exit ========
* Discontinue usage of NLDR module.
*/
void nldr_exit(void)
{
/* do nothing */
}
/* /*
* ======== nldr_get_fxn_addr ======== * ======== nldr_get_fxn_addr ========
*/ */
...@@ -735,16 +726,6 @@ int nldr_get_rmm_manager(struct nldr_object *nldr, ...@@ -735,16 +726,6 @@ int nldr_get_rmm_manager(struct nldr_object *nldr,
return status; return status;
} }
/*
* ======== nldr_init ========
* Initialize the NLDR module.
*/
bool nldr_init(void)
{
/* do nothing */
return true;
}
/* /*
* ======== nldr_load ======== * ======== nldr_load ========
*/ */
......
...@@ -159,7 +159,6 @@ struct node_mgr { ...@@ -159,7 +159,6 @@ struct node_mgr {
/* Loader properties */ /* Loader properties */
struct nldr_object *nldr_obj; /* Handle to loader */ struct nldr_object *nldr_obj; /* Handle to loader */
struct node_ldr_fxns nldr_fxns; /* Handle to loader functions */ struct node_ldr_fxns nldr_fxns; /* Handle to loader functions */
bool loader_init; /* Loader Init function succeeded? */
}; };
/* /*
...@@ -266,9 +265,7 @@ static struct node_ldr_fxns nldr_fxns = { ...@@ -266,9 +265,7 @@ static struct node_ldr_fxns nldr_fxns = {
nldr_allocate, nldr_allocate,
nldr_create, nldr_create,
nldr_delete, nldr_delete,
nldr_exit,
nldr_get_fxn_addr, nldr_get_fxn_addr,
nldr_init,
nldr_load, nldr_load,
nldr_unload, nldr_unload,
}; };
...@@ -1337,7 +1334,6 @@ int node_create_mgr(struct node_mgr **node_man, ...@@ -1337,7 +1334,6 @@ int node_create_mgr(struct node_mgr **node_man,
nldr_attrs_obj.write = mem_write; nldr_attrs_obj.write = mem_write;
nldr_attrs_obj.dsp_word_size = node_mgr_obj->dsp_word_size; nldr_attrs_obj.dsp_word_size = node_mgr_obj->dsp_word_size;
nldr_attrs_obj.dsp_mau_size = node_mgr_obj->dsp_mau_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, status = node_mgr_obj->nldr_fxns.create(&node_mgr_obj->nldr_obj,
hdev_obj, hdev_obj,
&nldr_attrs_obj); &nldr_attrs_obj);
...@@ -2507,9 +2503,6 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr) ...@@ -2507,9 +2503,6 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr)
if (hnode_mgr->nldr_obj) if (hnode_mgr->nldr_obj)
hnode_mgr->nldr_fxns.delete(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); kfree(hnode_mgr);
} }
} }
......
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