[UPDATED PATCH 17-8] fix refcount for non-modular case

Christoph Hellwig hch at infradead.org
Sat Nov 6 06:48:37 EST 2004


On Wed, Nov 03, 2004 at 04:14:30PM +0100, Dominik Brodowski wrote:
> -	struct pcmcia_driver *p_dev = container_of(driver, 
> +	struct pcmcia_driver *p_drv = container_of(driver, 
>  						   struct pcmcia_driver, drv);
>  
> -	*p += sprintf(*p, "%-24.24s 1 %d\n", driver->name, p_dev->use_count);
> +	*p += sprintf(*p, "%-24.24s 1 %d\n", p_drv->drv.name, 
> +#ifdef CONFIG_MODULE_UNLOAD
> +		      (p_drv->owner) ? module_refcount(p_drv->owner) : 1
> +#else
> +		      1
> +#endif

Might be better to send rusty a patch to make module_refcount useful for

 a) a NULL argument
 b) !CONFIG_MODULE_UNLOAD




More information about the linux-pcmcia mailing list