No, because sleeping isn't allowed in BH context. (Note that this is
2.4.26 code - things have changed a bit for 2.6, but the hardware is
the same, and still needs the I2C watchdog to be driven from a BH-like
The reason I'm asking about my scenario is because the GPIO routines
can't sleep and are used from a non-sleep safe context - but they are
not safe to call in irq contexts.
So my watchdog driver would have to call gpio_request (not _cansleep)
- that's fine. But if I connected other GPIOs from the same GPIO
driver (other lines on the same I/O expander chip) to another
GPIO-using driver which happens to use them from irq context, then
your changes won't detect the problem - the code will just break at
Of course if I did that, it would be my fault and my problem. I get
to keep both pieces etc. But it's a scenario which your proposal
would fail to catch at compile time, that's why I bring it up.