From 19b03c8fa76a940a8c12f4948114ec5a1772d3e2 Mon Sep 17 00:00:00 2001 From: Hyeonmyeong Choi Date: Sun, 9 Dec 2012 21:35:55 +0900 Subject: [PATCH] libv4l2: Add exynos_subdev close function Change-Id: I1450185c069a703fd272fcf4bb7e35804f11a8cd Signed-off-by: Hyeonmyeong Choi --- include/exynos_v4l2.h | 2 ++ libv4l2/exynos_subdev.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/exynos_v4l2.h b/include/exynos_v4l2.h index 22c06ce..1ceafa3 100644 --- a/include/exynos_v4l2.h +++ b/include/exynos_v4l2.h @@ -103,6 +103,8 @@ int exynos_subdev_open(const char *filename, int oflag, ...); /*! \ingroup exynos_v4l2 */ int exynos_subdev_open_devname(const char *devname, int oflag, ...); /*! \ingroup exynos_v4l2 */ +int exynos_subdev_close(int fd); +/*! \ingroup exynos_v4l2 */ int exynos_subdev_enum_frame_size(int fd, struct v4l2_subdev_frame_size_enum *frame_size_enum); /*! \ingroup exynos_v4l2 */ int exynos_subdev_g_fmt(int fd, struct v4l2_subdev_format *fmt); diff --git a/libv4l2/exynos_subdev.c b/libv4l2/exynos_subdev.c index 54b6e74..b6f3b02 100644 --- a/libv4l2/exynos_subdev.c +++ b/libv4l2/exynos_subdev.c @@ -131,6 +131,19 @@ int exynos_subdev_open_devname(const char *devname, int oflag, ...) return fd; } +int exynos_subdev_close(int fd) +{ + int ret = -1; + + ALOGE("%s", __func__); + if (fd < 0) + ALOGE("%s: invalid fd: %d", __func__, fd); + else + ret = close(fd); + + return ret; +} + /** * @brief enum frame size on a pad. * @return 0 on success, or a negative error code on failure. -- 2.20.1