svn commit: r239623 - head/sys/arm/at91

John Baldwin jhb at freebsd.org
Fri Aug 24 12:36:27 UTC 2012


On Thursday, August 23, 2012 5:31:52 pm Warner Losh wrote:
> Author: imp
> Date: Thu Aug 23 21:31:52 2012
> New Revision: 239623
> URL: http://svn.freebsd.org/changeset/base/239623
> 
> Log:
>   Use proper resource type when freeing.
>   
>   Submitted by:	Ian Lapore (indirectly in a larger patch)
> 
> Modified:
>   head/sys/arm/at91/at91_mci.c
> 
> Modified: head/sys/arm/at91/at91_mci.c
> 
==============================================================================
> --- head/sys/arm/at91/at91_mci.c	Thu Aug 23 19:40:28 2012	(r239622)
> +++ head/sys/arm/at91/at91_mci.c	Thu Aug 23 21:31:52 2012	(r239623)
> @@ -299,7 +299,7 @@ at91_mci_deactivate(device_t dev)
>  	sc->intrhand = 0;
>  	bus_generic_detach(sc->dev);
>  	if (sc->mem_res)
> -		bus_release_resource(dev, SYS_RES_IOPORT,
> +		bus_release_resource(dev, SYS_RES_MEMORY,
>  		    rman_get_rid(sc->mem_res), sc->mem_res);

If I had my way, it would just be 'bus_release_resource(dev, sc->mem_res);'.
There's no good reason the resource can't store its rid and type internally.

-- 
John Baldwin


More information about the svn-src-all mailing list