From 0c0a3440dbf5a7d08585201e045992a584417bf7 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 10 May 2002 19:08:58 +0000 Subject: [PATCH] Get rid of spurious "subdevice does not support commands" warnings. --- demo/info.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.26.2