From 06a7891c4dd4975f9d2edfe19babbf2efeb253bc Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 2 Aug 2004 00:09:51 +0000 Subject: [PATCH] fix check for presence of ao subdevice --- comedi_calibrate/cal_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/comedi_calibrate/cal_common.c b/comedi_calibrate/cal_common.c index 7f99c7a..5729396 100644 --- a/comedi_calibrate/cal_common.c +++ b/comedi_calibrate/cal_common.c @@ -284,7 +284,7 @@ int generic_cal_by_channel_and_range( calibration_setup_t *setup, num_ai_channels = comedi_get_n_channels( setup->dev, setup->ad_subdev ); if( num_ai_channels < 0 ) return -1; - if( setup->da_subdev && setup->do_output ) + if(setup->da_subdev >= 0 && setup->do_output ) { assert( comedi_range_is_chan_specific( setup->dev, setup->da_subdev ) == 0 ); @@ -363,7 +363,7 @@ int generic_cal_by_range( calibration_setup_t *setup, num_ai_ranges = comedi_get_n_ranges( setup->dev, setup->ad_subdev, 0 ); if( num_ai_ranges < 0 ) return -1; - if( setup->da_subdev && setup->do_output ) + if(setup->da_subdev >= 0 && setup->do_output ) { assert( comedi_range_is_chan_specific( setup->dev, setup->da_subdev ) == 0 ); @@ -432,7 +432,7 @@ int generic_cal_ao(calibration_setup_t *setup, comedi_calibration_setting_t *current_cal; - if(setup->da_subdev && setup->do_output) + if(setup->da_subdev >= 0 && setup->do_output) { assert( comedi_range_is_chan_specific( setup->dev, setup->da_subdev ) == 0 ); -- 2.26.2