Re: [PATCH 18/22] staging: comedi: ni_6527: tidy up the interrupt subdevice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013-10-02 12:17, Ian Abbott wrote:
On 2013-10-01 23:14, H Hartley Sweeten wrote:
Do the request_irq() before setting up the subdevices. Only initialize
the interrupt subdevice if the irq is actually available.

Since it's using IRQ_SHARED, you'll need add a test to the start of
ni6527_interrupt() to check dev->attached before accessing the subdevice:

     if (!dev->attached)
         return IRQ_NONE;


Actually, the first thing the interrupt does is read the status register, which should indicate that the device is not asserting a reset since the hardware has just been initialized by ni6527_reset() to disable and clear interrupts.

So it should be safe. It may still be worth checking one of dev->attached or dev->read_subdev for additional safety.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux