Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303025
b: refs/heads/master
c: 24dbc21
h: refs/heads/master
i:
  303023: e49d553
v: v3
  • Loading branch information
Paul Walmsley committed Apr 19, 2012
1 parent b76eff1 commit 0aa6391
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 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: 5d95dde7316101656102cb585b73381e4eaadaa7
refs/heads/master: 24dbc2130179ebd493a241f6f5972cf6524b933a
39 changes: 15 additions & 24 deletions trunk/arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,37 +1008,34 @@ static int _get_addr_space_by_name(struct omap_hwmod *oh, const char *name,
}

/**
* _find_mpu_port_index - find hwmod OCP slave port ID intended for MPU use
* _save_mpu_port_index - find and save the index to @oh's MPU port
* @oh: struct omap_hwmod *
*
* Returns the array index of the OCP slave port that the MPU
* addresses the device on, or -EINVAL upon error or not found.
* Determines the array index of the OCP slave port that the MPU uses
* to address the device, and saves it into the struct omap_hwmod.
* Intended to be called during hwmod registration only. No return
* value.
*/
static int __init _find_mpu_port_index(struct omap_hwmod *oh)
static void __init _save_mpu_port_index(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
struct omap_hwmod_ocp_if *os = NULL;
int i = 0;
int found = 0;

if (!oh)
return -EINVAL;
return;

oh->_int_flags |= _HWMOD_NO_MPU_PORT;

while (i < oh->slaves_cnt) {
os = _fetch_next_ocp_if(NULL, oh->slaves, &i);
if (os->user & OCP_USER_MPU) {
found = 1;
oh->_mpu_port_index = i - 1;
oh->_int_flags &= ~_HWMOD_NO_MPU_PORT;
break;
}
}

if (found)
pr_debug("omap_hwmod: %s: MPU OCP slave port ID %d\n",
oh->name, i - 1);
else
pr_debug("omap_hwmod: %s: no MPU OCP slave port found\n",
oh->name);

return (found) ? (i - 1) : -EINVAL;
return;
}

/**
Expand Down Expand Up @@ -1076,7 +1073,7 @@ static struct omap_hwmod_addr_space * __init _find_mpu_rt_addr_space(struct omap
int found = 0, i = 0;

os = _find_mpu_rt_port(oh);
if (!os->addr)
if (!os || !os->addr)
return NULL;

do {
Expand Down Expand Up @@ -2213,8 +2210,6 @@ static int __init _setup(struct omap_hwmod *oh, void *data)
*/
static int __init _register(struct omap_hwmod *oh)
{
int ms_id;

if (!oh || !oh->name || !oh->class || !oh->class->name ||
(oh->_state != _HWMOD_STATE_UNKNOWN))
return -EINVAL;
Expand All @@ -2224,11 +2219,7 @@ static int __init _register(struct omap_hwmod *oh)
if (_lookup(oh->name))
return -EEXIST;

ms_id = _find_mpu_port_index(oh);
if (!IS_ERR_VALUE(ms_id))
oh->_mpu_port_index = ms_id;
else
oh->_int_flags |= _HWMOD_NO_MPU_PORT;
_save_mpu_port_index(oh);

list_add_tail(&oh->node, &omap_hwmod_list);

Expand Down

0 comments on commit 0aa6391

Please sign in to comment.