Skip to content

Commit c0c3bf7

Browse files
committed
Merge tag 'omap-for-v6.6/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/arm
SoC changes for omaps for v6.6 SoC changes to include the correct devicetree headers, and an update to make use of_range_to_resource(). There is also a non-urgent fix for pwrdm_read_prev_pwrst() array-bounds warning. * tag 'omap-for-v6.6/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: omap2: Explicitly include correct DT includes ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch() ARM: omap2: Use of_range_to_resource() for "ranges" parsing Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents b5410ee + 2c32e60 commit c0c3bf7

File tree

4 files changed

+9
-44
lines changed

4 files changed

+9
-44
lines changed

arch/arm/mach-omap2/board-generic.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
* to support the OMAP2+ device tree boards with an unique board file.
1010
*/
1111
#include <linux/io.h>
12-
#include <linux/of_irq.h>
13-
#include <linux/of_platform.h>
1412
#include <linux/irqdomain.h>
1513
#include <linux/clocksource.h>
1614
#include <linux/clockchips.h>
15+
#include <linux/mod_devicetable.h>
1716

1817
#include <asm/setup.h>
1918
#include <asm/mach/arch.h>

arch/arm/mach-omap2/omap4-common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
#include <linux/io.h>
1313
#include <linux/irq.h>
1414
#include <linux/irqchip.h>
15-
#include <linux/platform_device.h>
1615
#include <linux/memblock.h>
16+
#include <linux/of.h>
1717
#include <linux/of_irq.h>
18-
#include <linux/of_platform.h>
1918
#include <linux/export.h>
2019
#include <linux/irqchip/arm-gic.h>
2120
#include <linux/of_address.h>

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)