const char *board_name;
const void *board_ptr;
- int attached;
+ bool attached:1;
spinlock_t spinlock;
struct mutex mutex;
int in_request_module;
static void __comedi_device_detach(struct comedi_device *dev)
{
- dev->attached = 0;
+ dev->attached = false;
if (dev->driver)
dev->driver->detach(dev);
else
dev->board_name = "BUG";
}
smp_wmb();
- dev->attached = 1;
+ dev->attached = true;
return 0;
}
static const int timeout = 10000;
unsigned long flags;
- if (dev->attached == 0)
+ if (!dev->attached)
return IRQ_NONE;
async = s->async;
/* an interrupt before all the postconfig stuff gets done could
* cause a NULL dereference if we continue through the
* interrupt handler */
- if (dev->attached == 0) {
+ if (!dev->attached) {
DEBUG_PRINT("premature interrupt, ignoring\n");
return IRQ_HANDLED;
}
int num_bytes, residue;
int buffer_index;
- if (dev->attached == 0) {
+ if (!dev->attached) {
comedi_error(dev, "premature interrupt");
return;
}
int status;
struct comedi_device *dev = d;
- if (dev->attached == 0) {
+ if (!dev->attached) {
comedi_error(dev, "premature interrupt");
return IRQ_HANDLED;
}
struct comedi_device *dev = d;
unsigned int status;
- if (dev->attached == 0) {
+ if (!dev->attached) {
comedi_error(dev, "premature interrupt");
return IRQ_HANDLED;
}
unsigned i;
unsigned long flags;
- if (dev->attached == 0)
+ if (!dev->attached)
return IRQ_NONE;
/* lock to avoid race with comedi_poll */
spin_lock_irqsave(&devpriv->interrupt_lock, flags);
short dpnt;
static const int sample_size = sizeof(devpriv->dma_buffer[0]);
- if (dev->attached == 0) {
+ if (!dev->attached) {
comedi_error(dev, "premature interrupt");
return IRQ_HANDLED;
}
struct comedi_async *async;
struct comedi_cmd *cmd;
- if (dev->attached == 0) {
+ if (!dev->attached) {
comedi_error(dev, "premature interrupt");
return IRQ_HANDLED;
}
struct mite_struct *mite = devpriv->mite;
#endif
- if (dev->attached == 0)
+ if (!dev->attached)
return IRQ_NONE;
smp_mb(); /* make sure dev->attached is checked before handler does anything else. */
unsigned int m_status = 0;
/* interrupcions parasites */
- if (dev->attached == 0) {
+ if (!dev->attached) {
/* assume it's from another card */
return IRQ_NONE;
}
uint8_t group;
uint16_t irqbit;
- if (dev->attached == 0)
+ if (!dev->attached)
return IRQ_NONE;
/* lock to avoid race with comedi_poll */
spin_lock_irqsave(&dev->spinlock, flags);