PERFORCE change 124491 for review
Constantine A. Murenin
cnst at FreeBSD.org
Wed Aug 1 14:42:42 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=124491
Change 124491 by cnst at dale on 2007/08/01 21:41:46
add lm_isa_detach for upcoming lm(4) module, which
will allow to test more logic from kern_sensors.c
Affected files ...
.. //depot/projects/soc2007/cnst-sensors/sys.dev.lm/lm78_isa.c#3 edit
Differences ...
==== //depot/projects/soc2007/cnst-sensors/sys.dev.lm/lm78_isa.c#3 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $P4: //depot/projects/soc2007/cnst-sensors/sys.dev.lm/lm78_isa.c#2 $ */
+/* $P4: //depot/projects/soc2007/cnst-sensors/sys.dev.lm/lm78_isa.c#3 $ */
/* $FreeBSD$ */
/* $OpenBSD: lm78_isa.c,v 1.2 2007/07/01 21:48:57 cnst Exp $ */
@@ -62,6 +62,7 @@
static int lm_isa_probe(struct device *);
static int lm_isa_attach(struct device *);
+static int lm_isa_detach(struct device *);
u_int8_t lm_isa_readreg(struct lm_softc *, int);
void lm_isa_writereg(struct lm_softc *, int, int);
@@ -69,6 +70,7 @@
/* Methods from the device interface */
DEVMETHOD(device_probe, lm_isa_probe),
DEVMETHOD(device_attach, lm_isa_attach),
+ DEVMETHOD(device_detach, lm_isa_detach),
/* Terminate method list */
{ 0, 0 }
@@ -222,6 +224,20 @@
return (0);
}
+int
+lm_isa_detach(struct device *dev)
+{
+ struct lm_isa_softc *sc = device_get_softc(dev);
+ int error;
+
+ /* Bus-independent detachment */
+ error = lm_detach(&sc->sc_lmsc);
+
+ bus_space_unmap(sc->sc_iot, sc->sc_ioh, 8);
+
+ return (error);
+}
+
u_int8_t
lm_isa_readreg(struct lm_softc *lmsc, int reg)
{
More information about the p4-projects
mailing list