Consult the "frequency" property associated with the device in the

dev_propdb, rather than using "board_info".
This commit is contained in:
thorpej 2003-07-04 02:21:02 +00:00
parent 1a4648d9ad
commit 5b7c5eadea
1 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_opb.c,v 1.8 2002/10/02 15:52:27 thorpej Exp $ */
/* $NetBSD: com_opb.c,v 1.9 2003/07/04 02:21:02 thorpej Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -39,7 +39,6 @@
#include <sys/device.h>
#include <sys/tty.h>
#include <sys/systm.h>
#include <sys/properties.h>
#include <lib/libkern/libkern.h>
@ -83,14 +82,16 @@ com_opb_attach(struct device *parent, struct device *self, void *aux)
sc->sc_iot = oaa->opb_bt;
sc->sc_iobase = oaa->opb_addr;
/* XXX console check */
bus_space_map(sc->sc_iot, oaa->opb_addr, COM_NPORTS, 0,
&sc->sc_ioh);
if (board_info_get("com-opb-frequency", &sc->sc_frequency,
sizeof(sc->sc_frequency)) == -1)
panic("com_opb_attach: no com-opb-frequency property");
/* XXX console check */
if (prop_get(dev_propdb, &sc->sc_dev, "frequency",
&sc->sc_frequency, sizeof(sc->sc_frequency), NULL) != 0) {
printf(": unable to get frequency property\n");
return;
}
com_attach_subr(sc);