diff options
author | Zyta Szpak <zr@semihalf.com> | 2021-02-19 14:31:45 +0000 |
---|---|---|
committer | Marcin Wojtas <mw@FreeBSD.org> | 2021-03-03 16:08:12 +0000 |
commit | 622d17da46eb360c3d6847e4da8dbb166b775d14 (patch) | |
tree | af96a9b0a7b090c155b712315dccebc279a10368 | |
parent | 28d945204ea1014d7de6906af8470ed8b3311335 (diff) | |
download | src-622d17da46eb360c3d684.tar.gz src-622d17da46eb360c3d684.zip |
arm64: mv_ap806_gicp: Fix spi_ranges_cnt
Previously the spi_ranges_cnt stored the table size in bytes
instead of the number of elements. Fix that.
Reviewed by: mmel
Submitted by: Zyta Szpak <zr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Marvell
-rw-r--r-- | sys/arm/mv/mv_ap806_gicp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arm/mv/mv_ap806_gicp.c b/sys/arm/mv/mv_ap806_gicp.c index da93a32f2b23..0a1a69707956 100644 --- a/sys/arm/mv/mv_ap806_gicp.c +++ b/sys/arm/mv/mv_ap806_gicp.c @@ -107,8 +107,8 @@ mv_ap806_gicp_attach(device_t dev) return (ENXIO); } - sc->spi_ranges_cnt = OF_getencprop_alloc(node, "marvell,spi-ranges", - (void **)&sc->spi_ranges); + sc->spi_ranges_cnt = OF_getencprop_alloc_multi(node, "marvell,spi-ranges", + sizeof(*sc->spi_ranges), (void **)&sc->spi_ranges); xref = OF_xref_from_node(node); if (intr_pic_register(dev, xref) == NULL) { @@ -153,7 +153,7 @@ mv_ap806_gicp_convert_map_data(struct mv_ap806_gicp_softc *sc, sc->parent_map_data->cells[2] = irq_type; /* Map the interrupt number to SPI number */ - for (i = 0; i < sc->spi_ranges_cnt / 2; i += 2) { + for (i = 0; i < sc->spi_ranges_cnt; i += 2) { if (irq_num < sc->spi_ranges[i + 1]) { irq_num += sc->spi_ranges[i]; break; |