summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/ebus
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2002-02-13 15:35:22 +0000
committertmm <tmm@FreeBSD.org>2002-02-13 15:35:22 +0000
commitcaee904afc8aaa5b1f7a901496c188d4053ad4a0 (patch)
treea8c1fb3b1b5e8cc10ce86676fda751f377e7e7e2 /sys/sparc64/ebus
parented060c43f1faf339b375198ce600e1d2b139f467 (diff)
downloadFreeBSD-src-caee904afc8aaa5b1f7a901496c188d4053ad4a0.zip
FreeBSD-src-caee904afc8aaa5b1f7a901496c188d4053ad4a0.tar.gz
Minor bug fixes (add a missing break, correct the resource ranges, remove
a memory leak).
Diffstat (limited to 'sys/sparc64/ebus')
-rw-r--r--sys/sparc64/ebus/ebus.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/sparc64/ebus/ebus.c b/sys/sparc64/ebus/ebus.c
index 2d3ebac..90560a9 100644
--- a/sys/sparc64/ebus/ebus.c
+++ b/sys/sparc64/ebus/ebus.c
@@ -289,6 +289,7 @@ ebus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
switch (which) {
case EBUS_IVAR_COMPAT:
*result = (uintptr_t)dinfo->edi_compat;
+ break;
case EBUS_IVAR_NAME:
*result = (uintptr_t)dinfo->edi_name;
break;
@@ -359,7 +360,7 @@ ebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
panic("ebus_alloc_resource: unsupported resource type %d",
type);
}
-
+
/*
* This inlines a modified resource_list_alloc(); this is needed
* because the resources need to be mapped into the bus space.
@@ -434,7 +435,7 @@ ebus_setup_dinfo(struct ebus_softc *sc, phandle_t node, char *name)
* that does not really matter.
*/
resource_list_add(&edi->edi_rl, SYS_RES_IOPORT, i,
- start, start + reg[i].size, reg[i].size);
+ start, start + reg[i].size - 1, reg[i].size);
}
nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs),
@@ -447,12 +448,13 @@ ebus_setup_dinfo(struct ebus_softc *sc, phandle_t node, char *name)
resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i,
intr, intr, 1);
}
+ free(reg, M_OFWPROP);
return (edi);
}
/*
- * NOTE: This does not free the name member (it is needed afterwars in some
+ * NOTE: This does not free the name member (it is needed afterwards in some
* cases).
*/
static void
OpenPOWER on IntegriCloud