V4L/DVB (9071): S2API: Implement result codes for individual commands

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>
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 7da2537..0ef9c2a 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1262,8 +1262,10 @@
 			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 @@
 			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;
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index 7c17c71..b561626 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -323,6 +323,7 @@
 			void *reserved2;
 		} buffer;
 	} u;
+	int result;
 } __attribute__ ((packed));
 
 /* No more than 16 properties during any given ioctl */