Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm32 Remove unncessary cf_unit usage.
details: https://anonhg.NetBSD.org/src/rev/d06b3914643e
branches: trunk
changeset: 482074:d06b3914643e
user: mark <mark%NetBSD.org@localhost>
date: Sun Feb 13 05:00:57 2000 +0000
description:
Remove unncessary cf_unit usage.
Make sure we only attach 1 of these devices.
diffstat:
sys/arch/arm32/dev/todclock.c | 4 ++--
sys/arch/arm32/footbridge/footbridge.c | 14 ++++++++++----
sys/arch/arm32/iomd/iomd.c | 13 +++++++++----
3 files changed, 21 insertions(+), 10 deletions(-)
diffs (108 lines):
diff -r be6660623ccb -r d06b3914643e sys/arch/arm32/dev/todclock.c
--- a/sys/arch/arm32/dev/todclock.c Sun Feb 13 04:59:57 2000 +0000
+++ b/sys/arch/arm32/dev/todclock.c Sun Feb 13 05:00:57 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: todclock.c,v 1.5 2000/01/07 23:43:45 mark Exp $ */
+/* $NetBSD: todclock.c,v 1.6 2000/02/13 05:00:57 mark Exp $ */
/*
* Copyright (c) 1994-1997 Mark Brinicombe.
@@ -109,7 +109,7 @@
{
struct todclock_attach_args *ta = aux;
- if (cf->cf_unit > 0)
+ if (todclock_sc != NULL)
return(0);
if (strcmp(ta->ta_name, "todclock") != 0)
return(0);
diff -r be6660623ccb -r d06b3914643e sys/arch/arm32/footbridge/footbridge.c
--- a/sys/arch/arm32/footbridge/footbridge.c Sun Feb 13 04:59:57 2000 +0000
+++ b/sys/arch/arm32/footbridge/footbridge.c Sun Feb 13 05:00:57 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: footbridge.c,v 1.3 2000/01/10 07:43:07 mark Exp $ */
+/* $NetBSD: footbridge.c,v 1.4 2000/02/13 05:00:57 mark Exp $ */
/*
* Copyright (c) 1997,1998 Mark Brinicombe.
@@ -90,6 +90,7 @@
/* Set to non-zero to enable verbose reporting of footbridge system ints */
int footbridge_intr_report = 0;
+int footbridge_found;
void
footbridge_pci_bs_tag_init(void)
@@ -133,9 +134,9 @@
struct cfdata *cf;
void *aux;
{
- if (cf->cf_unit == 0)
- return(1);
- return(0);
+ if (footbridge_found)
+ return(0);
+ return(1);
}
@@ -154,6 +155,9 @@
union footbridge_attach_args fba;
int vendor, device, rev;
+ /* There can only be 1 footbridge. */
+ footbridge_found = 1;
+
clock_sc = sc;
sc->sc_iot = &footbridge_bs_tag;
@@ -176,6 +180,8 @@
bus_space_write_4(sc->sc_iot, sc->sc_ioh, IRQ_ENABLE_CLEAR, 0xffffffff);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, FIQ_ENABLE_CLEAR, 0xffffffff);
+/* bus_space_write_4(sc->sc_iot, sc->sc_ioh, 0x18, 0x40000000);*/
+
/* Install a generic handler to catch a load of system interrupts */
sc->sc_serr_ih = intr_claim(IRQ_SERR, IPL_NONE,
"serr", footbridge_intr, sc);
diff -r be6660623ccb -r d06b3914643e sys/arch/arm32/iomd/iomd.c
--- a/sys/arch/arm32/iomd/iomd.c Sun Feb 13 04:59:57 2000 +0000
+++ b/sys/arch/arm32/iomd/iomd.c Sun Feb 13 05:00:57 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iomd.c,v 1.5 1998/04/17 18:44:09 mark Exp $ */
+/* $NetBSD: iomd.c,v 1.6 2000/02/13 05:00:57 mark Exp $ */
/*
* Copyright (c) 1996-1997 Mark Brinicombe.
@@ -91,6 +91,8 @@
extern struct bus_space iomd_bs_tag;
+int iomd_found;
+
/* Declare prototypes */
/*
@@ -121,9 +123,9 @@
struct cfdata *cf;
void *aux;
{
- if (cf->cf_unit == 0)
- return(1);
- return(0);
+ if (iomd_found)
+ return 0;
+ return 1;
}
@@ -152,6 +154,9 @@
bus_space_tag_t iot;
bus_space_handle_t ioh;
+ /* There can be only 1 IOMD. */
+ iomd_found = 1;
+
iot = sc->sc_iot = &iomd_bs_tag;
/* Map the IOMD */
Home |
Main Index |
Thread Index |
Old Index