]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9071): S2API: Implement result codes for individual commands
authorSteven Toth <stoth@linuxtv.org>
Fri, 26 Sep 2008 03:16:25 +0000 (00:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Oct 2008 11:37:11 +0000 (09:37 -0200)
This allows application developers to determine which particular
command in a sequence is invalid, or failing with error.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-core/dvb_frontend.c
include/linux/dvb/frontend.h

index 7da25372078c3018273fc00a932cfc2276c13ade..0ef9c2a2af879646d9515faf9f6e9ae2a10dd358 100644 (file)
@@ -1262,8 +1262,10 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,
                        goto out;
                }
 
-               for (i = 0; i < tvps->num; i++)
-                       err |= dtv_property_process_set(fe, tvp + i, inode, file);
+               for (i = 0; i < tvps->num; i++) {
+                       (tvp + i)->result = dtv_property_process_set(fe, tvp + i, inode, file);
+                       err |= (tvp + i)->result;
+               }
 
                if(fe->dtv_property_cache.state == DTV_TUNE) {
                        printk("%s() Property cache is full, tuning\n", __FUNCTION__);
@@ -1295,8 +1297,10 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,
                        goto out;
                }
 
-               for (i = 0; i < tvps->num; i++)
-                       err |= dtv_property_process_get(fe, tvp + i, inode, file);
+               for (i = 0; i < tvps->num; i++) {
+                       (tvp + i)->result = dtv_property_process_get(fe, tvp + i, inode, file);
+                       err |= (tvp + i)->result;
+               }
 
                if (copy_to_user(tvps->props, tvp, tvps->num * sizeof(struct dtv_property))) {
                        err = -EFAULT;
index 7c17c71edb593e31d92faf4b77bbf135e3fb6f66..b561626fc8a098388b322fa69270d817a53f2fdf 100644 (file)
@@ -323,6 +323,7 @@ struct dtv_property {
                        void *reserved2;
                } buffer;
        } u;
+       int result;
 } __attribute__ ((packed));
 
 /* No more than 16 properties during any given ioctl */