summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-05-19 23:11:34 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-05-19 23:11:34 +0200
commit5154f4d6f89e9853b768fc0ec470fa4dff5f890a (patch)
tree700d856bedf3d8cc088b5fc9b869f9a74e77d2cc
parentabbd1a3b585c685426196f066ad7fd417ed730a0 (diff)
Return -errno in functions returning a negative error code
errno is a positive value, fix functions that return errno when they are expected to return a negative error code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--subdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/subdev.c b/subdev.c
index 224b066..949f359 100644
--- a/subdev.c
+++ b/subdev.c
@@ -41,7 +41,7 @@ static int v4l2_subdev_open(struct media_entity *entity)
if (entity->fd == -1) {
printf("%s: Failed to open subdev device node %s\n", __func__,
entity->devname);
- return errno;
+ return -errno;
}
return 0;
@@ -64,7 +64,7 @@ int v4l2_subdev_get_format(struct media_entity *entity,
ret = ioctl(entity->fd, VIDIOC_SUBDEV_G_FMT, &fmt);
if (ret < 0)
- return errno;
+ return -errno;
*format = fmt.format;
return 0;
@@ -88,7 +88,7 @@ int v4l2_subdev_set_format(struct media_entity *entity,
ret = ioctl(entity->fd, VIDIOC_SUBDEV_S_FMT, &fmt);
if (ret < 0)
- return errno;
+ return -errno;
*format = fmt.format;
return 0;