Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Feb 2005 07:13:43 GMT
From:      John-Mark Gurney <jmg@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 71638 for review
Message-ID:  <200502230713.j1N7DhFe022442@repoman.freebsd.org>

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

Change 71638 by jmg@jmg_carbon on 2005/02/23 07:12:44

	keep the rid around for the resources if/when we release them...

Affected files ...

.. //depot/projects/arm/src/sys/arm/ep93xx/epclk.c#4 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/ep93xx/epclk.c#4 (text+ko) ====

@@ -115,10 +115,12 @@
 }
 
 struct epclk_softc {
+	int		sc_timerrid;
 	struct resource	*sc_timerres;
 	bus_space_tag_t	sc_iot;
 	bus_space_handle_t	sc_ioh;
 
+	int		sc_irqrid;
 	struct resource	*sc_irqres;
 	void		*sc_irqcookie;
 
@@ -131,13 +133,12 @@
 static int
 epclk_attach(device_t dev)
 {
-	int i;
 
 	epclk = device_get_softc(dev);
 
-	i = 0;
-	epclk->sc_timerres = bus_alloc_resource(dev, SYS_RES_MEMORY, &i, 0, ~0,
-	    ~0, RF_ACTIVE);
+	epclk->sc_timerrid = 0;
+	epclk->sc_timerres = bus_alloc_resource(dev, SYS_RES_MEMORY,
+	    &epclk->sc_timerrid, 0, ~0, ~0, RF_ACTIVE);
 
 	if (epclk->sc_timerres == NULL)
 		return ENXIO;
@@ -192,7 +193,6 @@
 void
 cpu_initclocks(void)
 {
-	int rid;
 
 	stathz = profhz = 0;
 
@@ -202,9 +202,9 @@
 	/* clear 64Hz interrupt status */
 	bus_space_write_4(epclk->sc_iot, epclk->sc_teoi_ioh, 0, 1);
 
-	rid = 0;
-	epclk->sc_irqres = bus_alloc_resource(epclk->dev, SYS_RES_IRQ, &rid,
-	    0, ~0, 1, RF_ACTIVE);
+	epclk->sc_irqrid = 0;
+	epclk->sc_irqres = bus_alloc_resource(epclk->dev, SYS_RES_IRQ,
+	    &epclk->sc_irqrid, 0, ~0, 1, RF_ACTIVE);
 	if (!epclk->sc_irqres)
 		panic("Unable to setup the clock irq handler.\n");
 	else



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