All of lore.kernel.org
 help / color / mirror / Atom feed
* radio-timb: proposed patch to convert to unlocked_ioctl
@ 2010-11-14 13:56 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2010-11-14 13:56 UTC (permalink / raw)
  To: Richard Röjfors; +Cc: linux-media

Hi Richard,

Can you check if this patch is OK? It's against the v2.6.38 media_tree branch.

It converts .ioctl to unlocked_ioctl by using the new v4l2 core locking. Before
it relied on the BKL to do the locking, but that is being phased out.

Regards,

	Hans

diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index b8bb3ef..a185610 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -34,6 +34,7 @@ struct timbradio {
 	struct v4l2_subdev	*sd_dsp;
 	struct video_device	video_dev;
 	struct v4l2_device	v4l2_dev;
+	struct mutex		lock;
 };
 
 
@@ -142,7 +143,7 @@ static const struct v4l2_ioctl_ops timbradio_ioctl_ops = {
 
 static const struct v4l2_file_operations timbradio_fops = {
 	.owner		= THIS_MODULE,
-	.ioctl		= video_ioctl2,
+	.unlocked_ioctl	= video_ioctl2,
 };
 
 static int __devinit timbradio_probe(struct platform_device *pdev)
@@ -164,6 +165,7 @@ static int __devinit timbradio_probe(struct platform_device *pdev)
 	}
 
 	tr->pdata = *pdata;
+	mutex_init(&tr->lock);
 
 	strlcpy(tr->video_dev.name, "Timberdale Radio",
 		sizeof(tr->video_dev.name));
@@ -171,6 +173,7 @@ static int __devinit timbradio_probe(struct platform_device *pdev)
 	tr->video_dev.ioctl_ops = &timbradio_ioctl_ops;
 	tr->video_dev.release = video_device_release_empty;
 	tr->video_dev.minor = -1;
+	tr->video_dev.lock = &tr->lock;
 
 	strlcpy(tr->v4l2_dev.name, DRIVER_NAME, sizeof(tr->v4l2_dev.name));
 	err = v4l2_device_register(NULL, &tr->v4l2_dev);

-- 
Hans Verkuil - video4linux developer - sponsored by Cisco

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-14 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-14 13:56 radio-timb: proposed patch to convert to unlocked_ioctl Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.