Re: Parport irq detection problem in 2.1.62 (patch supplied.)

Tim Waugh (tim@cyberelk.demon.co.uk)
Sun, 9 Nov 1997 14:29:35 +0000 (GMT)


On Fri, 7 Nov 1997, Niels Kristian Bech Jensen wrote:

> On Fri, 7 Nov 1997, Niels Kristian Bech Jensen wrote:
>
> > On Fri, 7 Nov 1997, Tim Waugh wrote:
> >
> > > Hmm, this looks like a problem with the code here:
> > >
> > > static int dma[PC_MAX_PORTS] = { PARPORT_DMA_AUTO, };
> > > static int irq[PC_MAX_PORTS] = { PARPORT_IRQ_AUTO, };
> > >
> > > The intention was do set the entire array to PARPORT_xxx_AUTO, but only
> > > the first element is initialised.
> > >
> > Thanks,
> >
> > This patch solves my problem (the code is taken from parport_init.c where
> > it inits the arrays for the parport_pc driver not compiled as a module.)
> >
> [patch removed]
>
> This wasn't the problem after all. __initdata is effectively a nop when
> used in a module. The problem (auto irq and dma test returns 0 when
> it should return PARPORT_IRQ_NONE/PARPORT_DMA_NONE) arrises when
> parport_probe.c (PnP) is compiled as a module (I haven't tried to compile
> it into the kernel.)

Well, one solution would presumably be to change the lines to something
like:

static int dma[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int irq[8] = {-1, -1, -1, -1, -1, -1, -1, -1};

Obviously that's not very good, as it kind of defeats the point of
PC_MAX_PORTS being a configurable constant. Could you just check that
this sort of thing fixes the problem?

Thanks,
Tim.
*/