Commit d4d91bc5 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Handle return status from comedi_dio_config

parent 2b84a29b
......@@ -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;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment