Skip to content

Commit 2c32e60

Browse files
committed
Merge branch 'omap-for-v6.5/cleanup' into omap-for-v6.6/soc
Merge in non-critical clean-up that was too late for v6.5. Signed-off-by: Tony Lindgren <[email protected]>
2 parents 1047e21 + 847fb80 commit 2c32e60

File tree

2 files changed

+7
-40
lines changed

2 files changed

+7
-40
lines changed

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,23 +2194,8 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
21942194
struct resource *res)
21952195
{
21962196
struct property *prop;
2197-
const __be32 *ranges;
21982197
const char *name;
2199-
u32 nr_addr, nr_size;
2200-
u64 base, size;
2201-
int len, error;
2202-
2203-
if (!res)
2204-
return -EINVAL;
2205-
2206-
ranges = of_get_property(np, "ranges", &len);
2207-
if (!ranges)
2208-
return -ENOENT;
2209-
2210-
len /= sizeof(*ranges);
2211-
2212-
if (len < 3)
2213-
return -EINVAL;
2198+
int err;
22142199

22152200
of_property_for_each_string(np, "compatible", prop, name)
22162201
if (!strncmp("ti,sysc-", name, 8))
@@ -2219,37 +2204,19 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
22192204
if (!name)
22202205
return -ENOENT;
22212206

2222-
error = of_property_read_u32(np, "#address-cells", &nr_addr);
2223-
if (error)
2224-
return -ENOENT;
2207+
err = of_range_to_resource(np, 0, res);
2208+
if (err)
2209+
return err;
22252210

2226-
error = of_property_read_u32(np, "#size-cells", &nr_size);
2227-
if (error)
2228-
return -ENOENT;
2229-
2230-
if (nr_addr != 1 || nr_size != 1) {
2231-
pr_err("%s: invalid range for %s->%pOFn\n", __func__,
2232-
oh->name, np);
2233-
return -EINVAL;
2234-
}
2235-
2236-
ranges++;
2237-
base = of_translate_address(np, ranges++);
2238-
size = be32_to_cpup(ranges);
2239-
2240-
pr_debug("omap_hwmod: %s %pOFn at 0x%llx size 0x%llx\n",
2241-
oh->name, np, base, size);
2211+
pr_debug("omap_hwmod: %s %pOFn at %pR\n",
2212+
oh->name, np, &res);
22422213

22432214
if (oh && oh->mpu_rt_idx) {
22442215
omap_hwmod_fix_mpu_rt_idx(oh, np, res);
22452216

22462217
return 0;
22472218
}
22482219

2249-
res->start = base;
2250-
res->end = base + size - 1;
2251-
res->flags = IORESOURCE_MEM;
2252-
22532220
return 0;
22542221
}
22552222

arch/arm/mach-omap2/powerdomain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
174174
break;
175175
case PWRDM_STATE_PREV:
176176
prev = pwrdm_read_prev_pwrst(pwrdm);
177-
if (pwrdm->state != prev)
177+
if (prev >= 0 && pwrdm->state != prev)
178178
pwrdm->state_counter[prev]++;
179179
if (prev == PWRDM_POWER_RET)
180180
_update_logic_membank_counters(pwrdm);

0 commit comments

Comments
 (0)