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 sandpoint: Use config_detach_ch...
details: https://anonhg.NetBSD.org/src/rev/5989a77b4833
branches: trunk
changeset: 374687:5989a77b4833
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed May 10 00:08:14 2023 +0000
description:
sandpoint: Use config_detach_children to reduce error branch bugs.
diffstat:
sys/arch/sandpoint/sandpoint/flash_cfi.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diffs (42 lines):
diff -r 7037819433cf -r 5989a77b4833 sys/arch/sandpoint/sandpoint/flash_cfi.c
--- a/sys/arch/sandpoint/sandpoint/flash_cfi.c Wed May 10 00:08:07 2023 +0000
+++ b/sys/arch/sandpoint/sandpoint/flash_cfi.c Wed May 10 00:08:14 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: flash_cfi.c,v 1.4 2015/09/07 23:00:08 phx Exp $ */
+/* $NetBSD: flash_cfi.c,v 1.5 2023/05/10 00:08:14 riastradh 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.4 2015/09/07 23:00:08 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: flash_cfi.c,v 1.5 2023/05/10 00:08:14 riastradh Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -158,16 +158,15 @@ sandpointcfi_attach(device_t parent, dev
static int
sandpointcfi_detach(device_t self, int flags)
{
- struct sandpointcfi_softc *sc;
- int rv;
+ struct sandpointcfi_softc *sc device_private(self);
+ int error;
+
+ error = config_detach_children(self, flags);
+ if (error)
+ return error;
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;
+ return 0;
}
Home |
Main Index |
Thread Index |
Old Index