Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sandpoint/sandpoint Revert my last modification.
details: https://anonhg.NetBSD.org/src/rev/774e637c6ffa
branches: trunk
changeset: 773275:774e637c6ffa
user: phx <phx%NetBSD.org@localhost>
date: Mon Jan 30 15:47:01 2012 +0000
description:
Revert my last modification.
The detach function might make sense to unload and replace a driver module.
http://mail-index.netbsd.org/source-changes-d/2012/01/24/msg004538.html
diffstat:
sys/arch/sandpoint/sandpoint/flash_cfi.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diffs (56 lines):
diff -r 380216f083b3 -r 774e637c6ffa sys/arch/sandpoint/sandpoint/flash_cfi.c
--- a/sys/arch/sandpoint/sandpoint/flash_cfi.c Mon Jan 30 13:57:43 2012 +0000
+++ b/sys/arch/sandpoint/sandpoint/flash_cfi.c Mon Jan 30 15:47:01 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: flash_cfi.c,v 1.2 2012/01/23 15:16:37 phx Exp $ */
+/* $NetBSD: flash_cfi.c,v 1.3 2012/01/30 15:47:01 phx Exp $ */
/*-
* Copyright (c) 2011 Frank Wille.
@@ -32,7 +32,7 @@
* NOR CFI driver support for sandpoint
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: flash_cfi.c,v 1.2 2012/01/23 15:16:37 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: flash_cfi.c,v 1.3 2012/01/30 15:47:01 phx Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -45,6 +45,7 @@
static int sandpointcfi_probe(device_t, cfdata_t, void *);
static void sandpointcfi_attach(device_t, device_t, void *);
+static int sandpointcfi_detach(device_t, int);
struct sandpointcfi_softc {
device_t sc_dev;
@@ -55,7 +56,7 @@
};
CFATTACH_DECL_NEW(sandpointcfi, sizeof(struct sandpointcfi_softc),
- sandpointcfi_probe, sandpointcfi_attach, NULL, NULL);
+ sandpointcfi_probe, sandpointcfi_attach, sandpointcfi_detach, NULL);
static int
sandpointcfi_probe(device_t parent, cfdata_t cf, void *aux)
@@ -152,3 +153,20 @@
sc->sc_nordev = nor_attach_mi(&sc->sc_nor_if, self);
}
+
+static int
+sandpointcfi_detach(device_t self, int flags)
+{
+ struct sandpointcfi_softc *sc;
+ int rv;
+
+ pmf_device_deregister(self);
+ sc = device_private(self);
+ rv = 0;
+
+ if (sc->sc_nordev != NULL)
+ rv = config_detach(sc->sc_nordev, flags);
+
+ bus_space_unmap(sc->sc_cfi.cfi_bst, sc->sc_cfi.cfi_bsh, sc->sc_size);
+ return rv;
+}
Home |
Main Index |
Thread Index |
Old Index