[PATCH] i82365: fix regions usage

Dominik Brodowski linux at dominikbrodowski.de
Sat Jan 29 16:07:39 EST 2005


Hi,

On Thu, Jan 27, 2005 at 06:29:32PM -0800, Randy.Dunlap wrote:
> 
> Convert one check_region() to request/release region.
> Remove second check_region since a following request_region()
> now does it.

>  /*====================================================================*/
> @@ -695,7 +698,13 @@ static void __init add_pcic(int ns, int 
>      struct i82365_socket *t = &socket[sockets-ns];
>  
>      base = sockets-ns;
> -    if (t->ioaddr > 0) request_region(t->ioaddr, 2, "i82365");
> +    if (t->ioaddr > 0) {
> +	if (!request_region(t->ioaddr, 2, "i82365")) {
> +	    printk(KERN_ERR "i82365: IO region conflict at %#lx, not available\n",
> +			t->ioaddr);
> +	    return;
> +	}
> +    }

Indeed this region is requested later. However, in the meantime identify()
happily reads from this region (which wouldn't be too bad), but also writes
to these region. So the region should be requested earlier, IMHO.

Thanks,
	Dominik


>      
>      if (base == 0) printk("\n");
>      printk(KERN_INFO "  %s", pcic[type].name);
> @@ -802,12 +811,6 @@ static void __init isa_probe(void)
>      }
>  #endif
>  
> -    if (check_region(i365_base, 2) != 0) {
> -	if (sockets == 0)
> -	    printk("port conflict at %#lx\n", i365_base);
> -	return;
> -    }
> -
>      id = identify(i365_base, 0);
>      if ((id == IS_I82365DF) && (identify(i365_base, 1) != id)) {
>  	for (i = 0; i < 4; i++) {

> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia




More information about the linux-pcmcia mailing list