Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235924
b: refs/heads/master
c: 59403c2
h: refs/heads/master
v: v3
  • Loading branch information
Ionut Nicu authored and Omar Ramirez Luna committed Feb 5, 2011
1 parent 8417782 commit 22337b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d723818e7c8f20af0a665f5b0c2eda909e069ffa
refs/heads/master: 59403c21afdcd2e89aeadc73b99ccd82d32733b3
51 changes: 16 additions & 35 deletions trunk/drivers/staging/tidspbridge/rmgr/mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props,
u32 undb_props_size, u32 *pu_num_nodes)
{
int status = 0;
struct dsp_uuid node_uuid, temp_uuid;
u32 temp_index = 0;
struct dsp_uuid node_uuid;
u32 node_index = 0;
struct dcd_genericobj gen_obj;
struct mgr_object *pmgr_obj = NULL;
Expand All @@ -149,52 +148,34 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props,
*pu_num_nodes = 0;
/* Get the Manager Object from the driver data */
if (!drv_datap || !drv_datap->mgr_object) {
status = -ENODATA;
pr_err("%s: Failed to retrieve the object handle\n", __func__);
goto func_cont;
} else {
pmgr_obj = drv_datap->mgr_object;
return -ENODATA;
}
pmgr_obj = drv_datap->mgr_object;

DBC_ASSERT(pmgr_obj);
/* Forever loop till we hit failed or no more items in the
* Enumeration. We will exit the loop other than 0; */
while (status == 0) {
status = dcd_enumerate_object(temp_index++, DSP_DCDNODETYPE,
&temp_uuid);
if (status == 0) {
node_index++;
if (node_id == (node_index - 1))
node_uuid = temp_uuid;

while (!status) {
status = dcd_enumerate_object(node_index++, DSP_DCDNODETYPE,
&node_uuid);
if (status)
break;
*pu_num_nodes = node_index;
if (node_id == (node_index - 1)) {
status = dcd_get_object_def(pmgr_obj->hdcd_mgr,
&node_uuid, DSP_DCDNODETYPE, &gen_obj);
if (status)
break;
/* Get the Obj def */
*pndb_props = gen_obj.obj_data.node_obj.ndb_props;
}
}

/* the last status is not 0, but neither an error */
if (status > 0)
status = 0;

if (!status) {
if (node_id > (node_index - 1)) {
status = -EINVAL;
} else {
status = dcd_get_object_def(pmgr_obj->hdcd_mgr,
(struct dsp_uuid *)
&node_uuid, DSP_DCDNODETYPE,
&gen_obj);
if (!status) {
/* Get the Obj def */
*pndb_props =
gen_obj.obj_data.node_obj.ndb_props;
*pu_num_nodes = node_index;
}
}
}

func_cont:
DBC_ENSURE((!status && *pu_num_nodes > 0) ||
(status && *pu_num_nodes == 0));

return status;
}

Expand Down

0 comments on commit 22337b6

Please sign in to comment.