Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Apr 2006 06:36:29 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 96291 for review
Message-ID:  <200604280636.k3S6aTLl034083@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96291

Change 96291 by marcel@marcel_nfs on 2006/04/28 06:35:41

	Use NULL as the device for unassigned resources.

Affected files ...

.. //depot/projects/uart/dev/puc/puc.c#41 edit

Differences ...

==== //depot/projects/uart/dev/puc/puc.c#41 (text+ko) ====

@@ -276,7 +276,7 @@
 		rm = (bar->b_type == SYS_RES_IOPORT)
 		    ? &sc->sc_ioport: &sc->sc_iomem;
 		port->p_rres = rman_reserve_resource(rm, start + ofs,
-		    start + ofs + size - 1, size, 0, sc->sc_dev);
+		    start + ofs + size - 1, size, 0, NULL);
 		if (port->p_rres != NULL) {
 			bsh = rman_get_bushandle(bar->b_res);
 			bst = rman_get_bustag(bar->b_res);
@@ -285,7 +285,7 @@
 			rman_set_bustag(port->p_rres, bst);
 		}
 		port->p_ires = rman_reserve_resource(&sc->sc_irq, port->p_nr,
-		    port->p_nr, 1, 0, sc->sc_dev);
+		    port->p_nr, 1, 0, NULL);
 		if (port->p_ires == NULL) {
 			error = ENXIO;
 			goto fail;
@@ -490,7 +490,7 @@
 		return (NULL);
 
 	assigned = rman_get_device(res);
-	if (assigned == dev)	/* Not allocated */
+	if (assigned == NULL)	/* Not allocated */
 		rman_set_device(res, originator);
 	else if (assigned != originator)
 		return (NULL);
@@ -498,8 +498,8 @@
 	if (flags & RF_ACTIVE) {
 		error = rman_activate_resource(res);
 		if (error) {
-			if (assigned == dev)
-				rman_set_device(res, dev);
+			if (assigned == NULL)
+				rman_set_device(res, NULL);
 			return (NULL);
 		}
 	}
@@ -542,7 +542,7 @@
 		return (ENXIO);
 	if (rman_get_flags(res) & RF_ACTIVE)
 		rman_deactivate_resource(res);
-	rman_set_device(res, dev);
+	rman_set_device(res, NULL);
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604280636.k3S6aTLl034083>