diff --git a/plugins/comedi/comedi.c b/plugins/comedi/comedi.c
index 423d377ae520a1722909b4ad05c04584e6a1d736..71c089bbb262409be1ddfa6d4af95aac216ec71d 100644
--- a/plugins/comedi/comedi.c
+++ b/plugins/comedi/comedi.c
@@ -332,17 +332,17 @@ static struct moberg_status channel_open(struct moberg_channel *channel)
   channel->context->descriptor.max = range->max;
   channel->context->descriptor.delta = (range->max - range->min) / maxdata;
   if (channel->kind == chan_DIGITALIN) {
-    if (comedi_dio_config(channel->context->device->comedi.handle,
-                          channel->context->descriptor.subdevice,
-                          channel->context->descriptor.subchannel,
-                          0)) {
+    if (0 > comedi_dio_config(channel->context->device->comedi.handle,
+                              channel->context->descriptor.subdevice,
+                              channel->context->descriptor.subchannel,
+                              0)) {
       goto err_errno;
     }
   } else if (channel->kind == chan_DIGITALOUT) {
-    if(comedi_dio_config(channel->context->device->comedi.handle,
-                         channel->context->descriptor.subdevice,
-                         channel->context->descriptor.subchannel,
-                         1)) {
+    if (0 > comedi_dio_config(channel->context->device->comedi.handle,
+                              channel->context->descriptor.subdevice,
+                              channel->context->descriptor.subchannel,
+                              1)) {
       goto err_errno;
     }
   }