Date:2011-07-06 23:43:07 (9 years 2 months ago)
Author:Werner Almesberger
Commit:64e0322abad52f9ca6566603e5df0f8e49c6a27d
Message:atusb: added interrupt URB removal on cleanup

This adds the cleanup but leaves some races open.

Signed-off-by: Werner Almesberger <werner@almesberger.net>
Files: drivers/spi/atusb.c (2 diffs)

Change Details

drivers/spi/atusb.c
608608    return 0;
609609
610610err_master:
611    /* @@@ kill interrupt URB */
611    /*
612     * If we come here from a partially successful driver initialization,
613     * we don't really know how much it has done. In particular, it may
614     * have triggered an interrupt and thus removed the interrupt URB and
615     * maybe scheduled the tasklet.
616     */
617    tasklet_disable(&atusb->task);
618    if (atusb->irq_urb)
619        usb_kill_urb(atusb->irq_urb);
612620    spi_master_put(atusb->master);
613621err_slave_irq:
614622    set_irq_chained_handler(atusb->slave_irq, NULL);
...... 
623631    struct atusb_local *atusb = usb_get_intfdata(interface);
624632    struct spi_master *master = atusb->master;
625633
626    /* @@@ kill interrupt URB */
634    tasklet_disable(&atusb->task);
635    /* @@@ this needs some extra protecion - wa */
636    if (atusb->irq_urb)
637        usb_kill_urb(atusb->irq_urb);
638
627639    usb_set_intfdata(interface, NULL);
628640    usb_put_dev(atusb->udev);
629641

Archive Download the corresponding diff file



interactive