Minor changes to make these more similar again.

This commit is contained in:
mycroft 1997-10-19 20:31:29 +00:00
parent 6cdaaab885
commit 87b7a8ba91
2 changed files with 20 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lms.c,v 1.31 1997/10/19 19:00:24 thorpej Exp $ */ /* $NetBSD: lms.c,v 1.32 1997/10/19 20:31:29 mycroft Exp $ */
/*- /*-
* Copyright (c) 1993, 1994 Charles Hannum. * Copyright (c) 1993, 1994 Charles Hannum.
@ -96,7 +96,7 @@ lmsprobe(parent, match, aux)
int rv; int rv;
/* Disallow wildcarded i/o base. */ /* Disallow wildcarded i/o base. */
if (ia->ia_iobase == IOBASEUNK) if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return 0; return 0;
/* Map the i/o space. */ /* Map the i/o space. */
@ -136,15 +136,19 @@ lmsattach(parent, self, aux)
{ {
struct lms_softc *sc = (void *)self; struct lms_softc *sc = (void *)self;
struct isa_attach_args *ia = aux; struct isa_attach_args *ia = aux;
bus_space_tag_t iot = ia->ia_iot;
bus_space_handle_t ioh;
printf("\n"); printf("\n");
/* Other initialization was done by lmsprobe. */ if (bus_space_map(iot, ia->ia_iobase, LMS_NPORTS, 0, &ioh)) {
sc->sc_iot = ia->ia_iot; printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
if (bus_space_map(sc->sc_iot, ia->ia_iobase, LMS_NPORTS, 0, return;
&sc->sc_ioh)) }
panic("lmsattach: couldn't map I/O ports");
/* Other initialization was done by lmsprobe. */
sc->sc_iot = iot;
sc->sc_ioh = ioh;
sc->sc_state = 0; sc->sc_state = 0;
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_PULSE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_PULSE,

View File

@ -1,4 +1,4 @@
/* $NetBSD: mms.c,v 1.28 1997/10/19 19:17:07 thorpej Exp $ */ /* $NetBSD: mms.c,v 1.29 1997/10/19 20:31:32 mycroft Exp $ */
/*- /*-
* Copyright (c) 1993, 1994 Charles Hannum. * Copyright (c) 1993, 1994 Charles Hannum.
@ -91,15 +91,18 @@ mmsprobe(parent, match, aux)
struct isa_attach_args *ia = aux; struct isa_attach_args *ia = aux;
bus_space_tag_t iot = ia->ia_iot; bus_space_tag_t iot = ia->ia_iot;
bus_space_handle_t ioh; bus_space_handle_t ioh;
int rv = 0; int rv;
/* Disallow wildcarded i/o address. */ /* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT) if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return 0; return 0;
/* Map the i/o space. */
if (bus_space_map(iot, ia->ia_iobase, MMS_NPORTS, 0, &ioh)) if (bus_space_map(iot, ia->ia_iobase, MMS_NPORTS, 0, &ioh))
return 0; return 0;
rv = 0;
/* Read identification register to see if present */ /* Read identification register to see if present */
if (bus_space_read_1(iot, ioh, MMS_IDENT) != 0xde) if (bus_space_read_1(iot, ioh, MMS_IDENT) != 0xde)
goto out; goto out;
@ -110,7 +113,8 @@ mmsprobe(parent, match, aux)
rv = 1; rv = 1;
ia->ia_iosize = MMS_NPORTS; ia->ia_iosize = MMS_NPORTS;
ia->ia_msize = 0; ia->ia_msize = 0;
out:
out:
bus_space_unmap(iot, ioh, MMS_NPORTS); bus_space_unmap(iot, ioh, MMS_NPORTS);
return rv; return rv;
} }
@ -299,11 +303,11 @@ mmsintr(arg)
void *arg; void *arg;
{ {
struct mms_softc *sc = arg; struct mms_softc *sc = arg;
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
u_char buttons, changed, status; u_char buttons, changed, status;
char dx, dy; char dx, dy;
u_char buffer[5]; u_char buffer[5];
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
if ((sc->sc_state & MMS_OPEN) == 0) if ((sc->sc_state & MMS_OPEN) == 0)
/* Interrupts are not expected. */ /* Interrupts are not expected. */