Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mmeye/dev Use cf_name to match instead of cd_name.
details: https://anonhg.NetBSD.org/src/rev/a69d33da55a2
branches: trunk
changeset: 761602:a69d33da55a2
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Wed Feb 02 04:46:25 2011 +0000
description:
Use cf_name to match instead of cd_name.
Call com_is_console().
Using bus_space_tag_t and bus_space_handle_t is manners for more machines.
diffstat:
sys/arch/mmeye/dev/com_mainbus.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diffs (63 lines):
diff -r fd03311e8c0d -r a69d33da55a2 sys/arch/mmeye/dev/com_mainbus.c
--- a/sys/arch/mmeye/dev/com_mainbus.c Wed Feb 02 04:29:59 2011 +0000
+++ b/sys/arch/mmeye/dev/com_mainbus.c Wed Feb 02 04:46:25 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com_mainbus.c,v 1.9 2008/04/28 20:23:29 martin Exp $ */
+/* $NetBSD: com_mainbus.c,v 1.10 2011/02/02 04:46:25 kiyohara Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.9 2008/04/28 20:23:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.10 2011/02/02 04:46:25 kiyohara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -70,10 +70,9 @@
int
com_mainbus_match(device_t parent, cfdata_t match, void *aux)
{
- extern struct cfdriver com_cd;
struct mainbus_attach_args *ma = aux;
- if (strcmp(ma->ma_name, com_cd.cd_name) == 0)
+ if (strcmp(ma->ma_name, match->cf_name) == 0)
return (1);
return (0);
@@ -85,13 +84,20 @@
struct mainbus_attach_args *ma = aux;
struct com_mainbus_softc *sc = device_private(self);
struct com_softc *csc = &sc->sc_com;
+ const bus_space_tag_t iot = 0;
+ bus_space_handle_t ioh;
+ if (!com_is_console(iot, ma->ma_addr1, &ioh))
+ if (bus_space_map(iot, ma->ma_addr1, COM_NPORTS, 0, &ioh)) {
+ aprint_error(": can't map i/o space\n");
+ return;
+ }
csc->sc_dev = self;
csc->sc_frequency = COM_FREQ;
- COM_INIT_REGS(csc->sc_regs, 0, ma->ma_addr1, 0);
+ COM_INIT_REGS(csc->sc_regs, iot, ioh, ma->ma_addr1);
/* sanity check */
- if (!comprobe1(0, ma->ma_addr1)) {
+ if (!comprobe1(iot, ioh)) {
aprint_error(": device problem. don't attach.\n");
return;
}
@@ -115,7 +121,8 @@
void
comcninit(struct consdev *cp)
{
+ const bus_space_tag_t iot = 0;
- comcnattach(0, CONADDR, COMCN_SPEED, COM_FREQ, COM_TYPE_NORMAL,
+ comcnattach(iot, CONADDR, COMCN_SPEED, COM_FREQ, COM_TYPE_NORMAL,
CONMODE);
}
Home |
Main Index |
Thread Index |
Old Index