Skip to content

Commit

Permalink
V4L/DVB (9071): S2API: Implement result codes for individual commands
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 459702b commit d48cb40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions include/linux/dvb/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ struct dtv_property {
void *reserved2;
} buffer;
} u;
int result;
} __attribute__ ((packed));

/* No more than 16 properties during any given ioctl */
Expand Down

0 comments on commit d48cb40

Please sign in to comment.