diff --git a/drivers/comedi/drivers/dt2815.c b/drivers/comedi/drivers/dt2815.c index 03ba2fd18a21..1578cebae8e7 100644 --- a/drivers/comedi/drivers/dt2815.c +++ b/drivers/comedi/drivers/dt2815.c @@ -183,6 +183,15 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) usleep_range(1000, 3000); status = inb(dev->iobase + DT2815_STATUS); + + /* 0xff usually indicates no hardware present on the bus */ + if (i == 0 && status == 0xff) { + dev_err(dev->class_dev, + "No hardware detected at I/O base 0x%lx\n", + dev->iobase); + return -ENODEV; + } + if (status == 4) { unsigned int program;