Re: radio-timb: proposed patch to convert to unlocked_ioctl
Hi Hans, On 11/14/2010 02:56 PM, Hans Verkuil wrote: Hi Richard, Can you check if this patch is OK? It's against the v2.6.38 media_tree branch. This patch is OK. I uncovered that the dsp and tuner are never added to the I2C bus, I'll provide a patch for it shortly which I would like you to apply after this patch. 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 Acked-by: Richard Röjfors richard.rojf...@pelagicore.com 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 mutexlock; }; @@ -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); -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: radio-timb: proposed patch to convert to unlocked_ioctl
Hi Hans, On 11/14/2010 02:56 PM, Hans Verkuil wrote: Hi Richard, Can you check if this patch is OK? It's against the v2.6.38 media_tree branch. Sorry for a late response, I will look at this now. Thanks for the patch work! --Richard -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
radio-timb: proposed patch to convert to unlocked_ioctl
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 mutexlock; }; @@ -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 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html