summaryrefslogtreecommitdiff
path: root/sys/arch/armish/dev/com_obio.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2006-06-16 01:31:36 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2006-06-16 01:31:36 +0000
commit8c7d26072be8244ca9aa2031cc6483e03e4f5b19 (patch)
tree7be60433a43ab5c44052fd6e9d7a673c3c5479bd /sys/arch/armish/dev/com_obio.c
parentcbea92781fea70c4837cb30839857ab7aa29a96d (diff)
If there is going to be a kludge to change the irq for com, do it early
enough so that the used irq is printed in dmesg.
Diffstat (limited to 'sys/arch/armish/dev/com_obio.c')
-rw-r--r--sys/arch/armish/dev/com_obio.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/armish/dev/com_obio.c b/sys/arch/armish/dev/com_obio.c
index 2d488cc2817..b8c40f917ca 100644
--- a/sys/arch/armish/dev/com_obio.c
+++ b/sys/arch/armish/dev/com_obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_obio.c,v 1.3 2006/06/01 18:46:05 drahn Exp $ */
+/* $OpenBSD: com_obio.c,v 1.4 2006/06/16 01:31:35 drahn Exp $ */
/* $NetBSD: com_obio.c,v 1.9 2005/12/11 12:17:09 christos Exp $ */
/*-
@@ -67,14 +67,21 @@ struct cfdriver com_obio_cd = {
NULL, "com_obio", DV_DULL
};
+int com_irq_override = -1;
+
int
com_obio_match(struct device *parent, void *cf, void *aux)
{
+ struct obio_attach_args *oba = aux;
+
+ /* if the irq does not match, do not attach */
+ if (com_irq_override != -1)
+ oba->oba_irq = com_irq_override;
+
/* We take it on faith that the device is there. */
return (1);
}
-int com_irq_override = -1;
void
com_obio_attach(struct device *parent, struct device *self, void *aux)
@@ -84,10 +91,6 @@ com_obio_attach(struct device *parent, struct device *self, void *aux)
struct com_softc *sc = &osc->sc_com;
int error;
- /* XXX old value is already printed */
- if (com_irq_override != -1)
- oba->oba_irq = com_irq_override;
-
sc->sc_iot = oba->oba_st;
sc->sc_iobase = oba->oba_addr;
sc->sc_frequency = COM_FREQ;