diff mbox

[RFCv2,08/10] radio-cadet: use v4l2_fh helper functions

Message ID 362367dfefbbed04a99e28acedf68b8c28f820a6.1294078230.git.hverkuil@xs4all.nl (mailing list archive)
State RFC
Headers show

Commit Message

Hans Verkuil Jan. 3, 2011, 6:31 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index bc9ad08..9dbbb41 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -42,6 +42,7 @@ 
 #include <linux/io.h>		/* outb, outb_p			*/
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
+#include <media/v4l2-fh.h>
 
 MODULE_AUTHOR("Fred Gleason, Russell Kroll, Quay Lu, Donald Song, Jason Lewis, Scott McGrath, William McGrath");
 MODULE_DESCRIPTION("A driver for the ADS Cadet AM/FM/RDS radio card.");
@@ -526,7 +527,10 @@  static int vidioc_s_audio(struct file *file, void *priv,
 static int cadet_open(struct file *file)
 {
 	struct cadet *dev = video_drvdata(file);
+	int ret = v4l2_fh_open(file);
 
+	if (ret)
+		return ret;
 	mutex_lock(&dev->lock);
 	dev->users++;
 	if (1 == dev->users)
@@ -546,7 +550,7 @@  static int cadet_release(struct file *file)
 		dev->rdsstat = 0;
 	}
 	mutex_unlock(&dev->lock);
-	return 0;
+	return v4l2_fh_release(file);
 }
 
 static unsigned int cadet_poll(struct file *file, struct poll_table_struct *wait)