Re: [PATCH] opl3sa2 isapnp activation fix

Zwane Mwaikambo (zwane@linux.realnet.co.sz)
Tue, 4 Jun 2002 17:55:48 +0200 (SAST)


On Tue, 4 Jun 2002, Zwane Mwaikambo wrote:

> > if(dev->activate(dev) < 0) {
> > - printk(KERN_WARNING PFX "ISA PnP activate failed\n");
> > - opl3sa2_state[card].activated = 0;
> > - return -ENODEV;
> > + /*
> > + * isapnp.c disallows dma=0 but some opl3sa2 cards need it.
> > + * So we set dma by hand and try again
> > + */
> > + if (dma < 0 || dma > 7)
> > + dma= 0;
> > + if (dma2 < 0 || dma2 >7)
> > + dma2= 1;
>
> Oops, that won't work on isapnp since dma = dma2 = -1 at this stage, how
> about;
>
> if ((dma != -1) && (dma2 != -1)) frob();
>
> you shouldn't hard set 0,1

You can move the check earlier on so that you do the first activate with
the supplied dma settings, therefore avoiding the double take. That way
you'd also not add any additional frobbing for the normal case.

-- 
http://function.linuxpower.ca
		

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/