summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/imx
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-06-09 12:35:47 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-06-09 12:35:47 +0000
commitde127c414f5d22ccf38e4e8453e29924a30d67ad (patch)
treebb8697e30739db519af6a20b339aa5ea8b0eff1e /sys/arch/armv7/imx
parentb9c62d76b23e91a0195899261c51930d190fa995 (diff)
Make use of the information about the node passed down to us by simplebus(4).
ok jsg@
Diffstat (limited to 'sys/arch/armv7/imx')
-rw-r--r--sys/arch/armv7/imx/imxiic.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/arch/armv7/imx/imxiic.c b/sys/arch/armv7/imx/imxiic.c
index 7940a124c35..95875fb8c98 100644
--- a/sys/arch/armv7/imx/imxiic.c
+++ b/sys/arch/armv7/imx/imxiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxiic.c,v 1.6 2016/05/21 12:37:28 kettenis Exp $ */
+/* $OpenBSD: imxiic.c,v 1.7 2016/06/09 12:35:46 kettenis Exp $ */
/*
* Copyright (c) 2013 Patrick Wildt <patrick@blueri.se>
*
@@ -114,17 +114,16 @@ imxiic_attach(struct device *parent, struct device *self, void *aux)
{
struct imxiic_softc *sc = (struct imxiic_softc *)self;
struct fdt_attach_args *faa = aux;
- uint32_t reg[2];
- if (OF_getprop(faa->fa_node, "reg", &reg, sizeof(reg)) != sizeof(reg))
+ if (faa->fa_nreg < 2)
return;
sc->sc_iot = faa->fa_iot;
- sc->sc_ios = bemtoh32(&reg[1]);
+ sc->sc_ios = faa->fa_reg[1];
sc->sc_node = faa->fa_node;
- sc->unit = (bemtoh32(&reg[0]) & 0xc000) >> 14;
- if (bus_space_map(sc->sc_iot, bemtoh32(&reg[0]),
- bemtoh32(&reg[1]), 0, &sc->sc_ioh))
+ sc->unit = (faa->fa_reg[0] & 0xc000) >> 14;
+ if (bus_space_map(sc->sc_iot, faa->fa_reg[0],
+ faa->fa_reg[1], 0, &sc->sc_ioh))
panic("imxiic_attach: bus_space_map failed!");
#if 0