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: <abbo...@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to