Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196210
b: refs/heads/master
c: 682fdc9
h: refs/heads/master
v: v3
  • Loading branch information
Benoit Cousson authored and Paul Walmsley committed May 20, 2010
1 parent d28ea53 commit 3f685ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 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: 33f7ec81fb3e525eec0575f33dbab02240eda6d4
refs/heads/master: 682fdc96f3afb5ec34e4893fae41d09346d656ed
30 changes: 16 additions & 14 deletions trunk/arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,16 @@ static int _init_main_clk(struct omap_hwmod *oh)
*/
static int _init_interface_clks(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
struct clk *c;
int i;
int ret = 0;

if (oh->slaves_cnt == 0)
return 0;

for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) {
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];

if (!os->clk)
continue;

Expand Down Expand Up @@ -490,7 +491,6 @@ static int _init_opt_clks(struct omap_hwmod *oh)
*/
static int _enable_clocks(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
int i;

pr_debug("omap_hwmod: %s: enabling clocks\n", oh->name);
Expand All @@ -499,7 +499,8 @@ static int _enable_clocks(struct omap_hwmod *oh)
clk_enable(oh->_clk);

if (oh->slaves_cnt > 0) {
for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) {
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];
struct clk *c = os->_clk;

if (c && !IS_ERR(c) && (os->flags & OCPIF_SWSUP_IDLE))
Expand All @@ -520,7 +521,6 @@ static int _enable_clocks(struct omap_hwmod *oh)
*/
static int _disable_clocks(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
int i;

pr_debug("omap_hwmod: %s: disabling clocks\n", oh->name);
Expand All @@ -529,7 +529,8 @@ static int _disable_clocks(struct omap_hwmod *oh)
clk_disable(oh->_clk);

if (oh->slaves_cnt > 0) {
for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) {
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];
struct clk *c = os->_clk;

if (c && !IS_ERR(c) && (os->flags & OCPIF_SWSUP_IDLE))
Expand All @@ -551,14 +552,15 @@ static int _disable_clocks(struct omap_hwmod *oh)
*/
static int _find_mpu_port_index(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
int i;
int found = 0;

if (!oh || oh->slaves_cnt == 0)
return -EINVAL;

for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) {
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];

if (os->user & OCP_USER_MPU) {
found = 1;
break;
Expand Down Expand Up @@ -593,7 +595,7 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
if (!oh || oh->slaves_cnt == 0)
return NULL;

os = *oh->slaves + index;
os = oh->slaves[index];

for (i = 0, mem = os->addr; i < os->addr_cnt; i++, mem++) {
if (mem->flags & ADDR_TYPE_RT) {
Expand Down Expand Up @@ -806,7 +808,7 @@ static int _wait_target_ready(struct omap_hwmod *oh)
if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
return 0;

os = *oh->slaves + oh->_mpu_port_index;
os = oh->slaves[oh->_mpu_port_index];

if (oh->flags & HWMOD_NO_IDLEST)
return 0;
Expand Down Expand Up @@ -1000,15 +1002,15 @@ static int _shutdown(struct omap_hwmod *oh)
*/
static int _setup(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
int i, r;

if (!oh)
return -EINVAL;

/* Set iclk autoidle mode */
if (oh->slaves_cnt > 0) {
for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) {
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];
struct clk *c = os->_clk;

if (!c || IS_ERR(c))
Expand Down Expand Up @@ -1438,7 +1440,7 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh)
ret = oh->mpu_irqs_cnt + oh->sdma_chs_cnt;

for (i = 0; i < oh->slaves_cnt; i++)
ret += (*oh->slaves + i)->addr_cnt;
ret += oh->slaves[i]->addr_cnt;

return ret;
}
Expand Down Expand Up @@ -1479,7 +1481,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os;

os = *oh->slaves + i;
os = oh->slaves[i];

for (j = 0; j < os->addr_cnt; j++) {
(res + r)->start = (os->addr + j)->pa_start;
Expand Down

0 comments on commit 3f685ce

Please sign in to comment.