From: David Schleef <ds@schleef.org>
Date: Fri, 10 May 2002 19:08:58 +0000 (+0000)
Subject: Get rid of spurious "subdevice does not support commands" warnings.
X-Git-Tag: r0_7_19~48
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c0a3440dbf5a7d08585201e045992a584417bf7;p=comedilib.git

Get rid of spurious "subdevice does not support commands" warnings.
---

diff --git a/demo/info.c b/demo/info.c
index bc99af1..7b3b7e2 100644
--- a/demo/info.c
+++ b/demo/info.c
@@ -123,6 +123,10 @@ int comedi_get_cmd_src_mask(comedi_t *it,unsigned int s,comedi_cmd *cmd)
 {
 	memset(cmd,0,sizeof(*cmd));
 
+	if(!(comedi_get_subdevice_flags(it,s)&SDF_CMD)){
+		return -1;
+	}
+
 	cmd->subdev = s;
 
 	cmd->flags = 0;
@@ -141,7 +145,8 @@ int comedi_get_cmd_fast_1chan(comedi_t *it,unsigned int s,comedi_cmd *cmd)
 {
 	int ret;
 
-	comedi_get_cmd_src_mask(it,s,cmd);
+	ret = comedi_get_cmd_src_mask(it,s,cmd);
+	if(ret<0)return ret;
 
 	cmd->chanlist_len = 1;