diff options
author | Michael Knudsen <mk@cvs.openbsd.org> | 2009-04-17 21:48:55 +0000 |
---|---|---|
committer | Michael Knudsen <mk@cvs.openbsd.org> | 2009-04-17 21:48:55 +0000 |
commit | 72e270858c3440575c598b359e7bd4a974aef645 (patch) | |
tree | fec6641b9f0cfb7b620ed87922e43c754c592167 /sys/dev | |
parent | bdd9d7559ed63a1990afd1f19e65fbe13acc0bd8 (diff) |
schsio_probe() reads the chip id to find out if we should attach or not.
schsio_attach() then later reads the chip id to print which device we
found.
I noticed that isa_attach_args has a field called ia_aux which can be
used for driver specific stuff, so stuff the device id in there so we
don't need to get the value from the chip again during attach.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/isa/sch311x.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/isa/sch311x.c b/sys/dev/isa/sch311x.c index 7425098e234..12762e125db 100644 --- a/sys/dev/isa/sch311x.c +++ b/sys/dev/isa/sch311x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sch311x.c,v 1.8 2009/04/16 20:16:04 mk Exp $ */ +/* $OpenBSD: sch311x.c,v 1.9 2009/04/17 21:48:54 mk Exp $ */ /* * Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2009 Michael Knudsen <mk@openbsd.org> @@ -248,6 +248,7 @@ schsio_probe(struct device *parent, void *match, void *aux) ia->ipa_nmem = 0; ia->ipa_nirq = 0; ia->ipa_ndrq = 0; + ia->ia_aux = (void *)(u_long) reg; return (1); break; @@ -275,8 +276,8 @@ schsio_attach(struct device *parent, struct device *self, void *aux) /* Enter configuration mode */ schsio_config_enable(sc->sc_iot, sc->sc_ioh); - /* Read device ID */ - reg0 = schsio_config_read(sc->sc_iot, sc->sc_ioh, SCHSIO_IDX_DEVICE); + /* Check device ID */ + reg0 = (u_int8_t)(u_long) ia->ia_aux; switch (reg0) { case SCHSIO_ID_SCH3112: printf(": SCH3112"); |