Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/isa Add and enable detachment and child detachment f...
details: https://anonhg.NetBSD.org/src/rev/28551e8cdb56
branches: trunk
changeset: 772825:28551e8cdb56
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Tue Jan 17 16:32:03 2012 +0000
description:
Add and enable detachment and child detachment functions.
diffstat:
sys/dev/isa/wbsio.c | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diffs (49 lines):
diff -r 259399da0016 -r 28551e8cdb56 sys/dev/isa/wbsio.c
--- a/sys/dev/isa/wbsio.c Tue Jan 17 16:28:33 2012 +0000
+++ b/sys/dev/isa/wbsio.c Tue Jan 17 16:32:03 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wbsio.c,v 1.4 2012/01/17 16:28:33 jakllsch Exp $ */
+/* $NetBSD: wbsio.c,v 1.5 2012/01/17 16:32:03 jakllsch Exp $ */
/* $OpenBSD: wbsio.c,v 1.5 2009/03/29 21:53:52 sthen Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis <kettenis%openbsd.org@localhost>
@@ -69,10 +69,12 @@
int wbsio_probe(device_t, cfdata_t, void *);
void wbsio_attach(device_t, device_t, void *);
+int wbsio_detach(device_t, int);
+void wbsio_childdet(device_t, device_t);
int wbsio_print(void *, const char *);
-CFATTACH_DECL_NEW(wbsio, sizeof(struct wbsio_softc),
- wbsio_probe, wbsio_attach, NULL, NULL);
+CFATTACH_DECL2_NEW(wbsio, sizeof(struct wbsio_softc),
+ wbsio_probe, wbsio_attach, wbsio_detach, NULL, NULL, wbsio_childdet);
static __inline void
wbsio_conf_enable(bus_space_tag_t iot, bus_space_handle_t ioh)
@@ -228,6 +230,24 @@
}
int
+wbsio_detach(device_t self, int flags)
+{
+ int rc;
+
+ if ((rc = config_detach_children(self, flags)) != 0)
+ return rc;
+ bus_space_unmap(sc->sc_iot, sc->sc_ioh, WBSIO_IOSIZE);
+ pmf_device_deregister(self);
+ return 0;
+}
+
+void
+wbsio_childdet(device_t self, device_t child)
+{
+ return;
+}
+
+int
wbsio_print(void *aux, const char *pnp)
{
struct isa_attach_args *ia = aux;
Home |
Main Index |
Thread Index |
Old Index