Re: [PARPORT] patch-2.1.91pre2-parport980327


Andrea Arcangeli (arcangeli@mbox.queen.it)
Tue, 31 Mar 1998 17:50:14 +0200 (CEST)


On Tue, 31 Mar 1998, Andrea Arcangeli wrote:

>On Fri, 27 Mar 1998, Tim Waugh wrote:
>
>>Hi guys,
>>
>>Please try out this patch:
>>
>><ftp://ftp.torque.net/pub/parport/patch-2.1.91pre2-parport980327>
>
>The patch seems to be mainly wrong. It is completly wrong define the
>lp flags inside parport.h. These flags give us the semantic of how _lp_
>handle the 8255 signal lines. How can be useful PARPORT_STATUS_PAPEROUT
>for a parallel ZIP drive for example?
>
>All parport_timedout() macro should be also moved into lp.h and all must
>be renamed from PARPORT_xxx and parport_xxx to LP_xxx and lp_xxx.
>
>This only after a short read of the patch...

The irq_write_proc() patch in parport_procfs.c is broken too.

 static int irq_write_proc(struct file *file, const char *buffer,
                                           unsigned long count, void *data)
 {
- int newirq, oldirq;
+ int retval = -EINVAL;
+ int newirq = PARPORT_IRQ_NONE;
         struct parport *pp = (struct parport *)data;
-
- if (count > 5 ) /* more than 4 digits + \n for a irq 0x?? 0?? ?? */
- return -EOVERFLOW;

You can' t do that if you first don' t check the COMA flag:

+ struct pardevice *cad = pp->cad;
+ int oldirq = pp->irq;
[...]
- return -EOVERFLOW;
+ retval = count;
 
We was not stupid doing that:

- if (pp->irq != PARPORT_IRQ_NONE && !(pp->flags & PARPORT_FLAG_COMA)) {
- if (pp->cad != NULL && pp->cad->irq_func != NULL)
- free_irq(pp->irq, pp->cad->private);
- else
- free_irq(pp->irq, NULL);
- }
+ if (oldirq == newirq)
+ goto out;
 
- oldirq = pp->irq;
- pp->irq = newirq;
+ if (pp->flags & PARPORT_FLAG_COMA)

You are going to assign the irq for a COMA parport!

+ goto out_ok;
 
- if (pp->irq != PARPORT_IRQ_NONE && !(pp->flags & PARPORT_FLAG_COMA)) {
- struct pardevice *cad = pp->cad;
+ if (newirq != PARPORT_IRQ_NONE) {
+ void (*handler)(int, void *, struct pt_regs *);

Andrea[s] Arcangeli

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:34 EST