Module Name:    src
Committed By:   tsutsui
Date:           Sat May 16 06:44:05 UTC 2009

Modified Files:
        src/sys/dev/cardbus: ahc_cardbus.c
        src/sys/dev/ic: aic7xxx_osm.c aic7xxx_osm.h

Log Message:
Make ahc_detach() take struct ahc_softc * as well as ahc_attach()
and remove bogus casts around ahc_detach().

XXX: There is a pmf_device_deregister(9) call in ahc_detach()
XXX: while there is no pmf_device_register(9) in ahc_attach().
XXX: It looks more pmf(9) stuff is required for cardbus detach.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/cardbus/ahc_cardbus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/aic7xxx_osm.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/aic7xxx_osm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/ahc_cardbus.c
diff -u src/sys/dev/cardbus/ahc_cardbus.c:1.27 src/sys/dev/cardbus/ahc_cardbus.c:1.28
--- src/sys/dev/cardbus/ahc_cardbus.c:1.27	Tue May  5 09:51:23 2009
+++ src/sys/dev/cardbus/ahc_cardbus.c	Sat May 16 06:44:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahc_cardbus.c,v 1.27 2009/05/05 09:51:23 cegger Exp $	*/
+/*	$NetBSD: ahc_cardbus.c,v 1.28 2009/05/16 06:44:05 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.27 2009/05/05 09:51:23 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.28 2009/05/16 06:44:05 tsutsui Exp $");
 
 #include "opt_ahc_cardbus.h"
 
@@ -263,7 +263,7 @@
 
 	int rv;
 
-	rv = ahc_detach((void *)ahc, flags);
+	rv = ahc_detach(ahc, flags);
 	if (rv)
 		return rv;
 

Index: src/sys/dev/ic/aic7xxx_osm.c
diff -u src/sys/dev/ic/aic7xxx_osm.c:1.30 src/sys/dev/ic/aic7xxx_osm.c:1.31
--- src/sys/dev/ic/aic7xxx_osm.c:1.30	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/aic7xxx_osm.c	Sat May 16 06:44:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx_osm.c,v 1.30 2009/05/12 14:25:17 cegger Exp $	*/
+/*	$NetBSD: aic7xxx_osm.c,v 1.31 2009/05/16 06:44:05 tsutsui Exp $	*/
 
 /*
  * Bus independent FreeBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic7xxx_osm.c,v 1.30 2009/05/12 14:25:17 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic7xxx_osm.c,v 1.31 2009/05/16 06:44:05 tsutsui Exp $");
 
 #include <dev/ic/aic7xxx_osm.h>
 #include <dev/ic/aic7xxx_inline.h>
@@ -1037,19 +1037,17 @@
 }
 
 int
-ahc_detach(device_t self, int flags)
+ahc_detach(struct ahc_softc *ahc, int flags)
 {
 	int rv = 0;
 
-	struct ahc_softc *ahc = (struct ahc_softc*)self;
-
 	ahc_intr_enable(ahc, FALSE);
 	if (ahc->sc_child != NULL)
 		rv = config_detach(ahc->sc_child, flags);
 	if (rv == 0 && ahc->sc_child_b != NULL)
 		rv = config_detach(ahc->sc_child_b, flags);
 
-	pmf_device_deregister(self);
+	pmf_device_deregister(ahc->sc_dev);
 	ahc_free(ahc);
 
 	return (rv);

Index: src/sys/dev/ic/aic7xxx_osm.h
diff -u src/sys/dev/ic/aic7xxx_osm.h:1.23 src/sys/dev/ic/aic7xxx_osm.h:1.24
--- src/sys/dev/ic/aic7xxx_osm.h:1.23	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/aic7xxx_osm.h	Sat May 16 06:44:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx_osm.h,v 1.23 2009/05/12 14:25:17 cegger Exp $	*/
+/*	$NetBSD: aic7xxx_osm.h,v 1.24 2009/05/16 06:44:05 tsutsui Exp $	*/
 
 /*
  * NetBSD platform specific driver option settings, data structures,
@@ -526,7 +526,7 @@
 int	  ahc_map_int(struct ahc_softc *);
 int	  ahc_attach(struct ahc_softc *);
 int	  ahc_softc_comp(struct ahc_softc *, struct ahc_softc *);
-int	  ahc_detach(device_t, int);
+int	  ahc_detach(struct ahc_softc *, int);
 
 /****************************** Interrupts ************************************/
 void			ahc_platform_intr(void *);

Reply via email to