Commit 601e9444 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (8786): v4l2: remove the priv field, use dev_get_drvdata instead



Remove the priv field and let video_get/set_drvdata use dev_get_drvdata
and dev_set_drvdata instead.

Convert all drivers that still used priv directly.

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e138c592
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -533,7 +533,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
	memcpy(vfd, &device_template, sizeof(struct video_device));
	strlcpy(vfd->name, name, sizeof(vfd->name));
	vfd->release = video_device_release;
	vfd->priv = dev;
	video_set_drvdata(vfd, dev);

	// fixme: -1 should be an insmod parameter *for the extension* (like "video_nr");
	if (video_register_device(vfd, type, -1) < 0) {
+6 −6
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
					struct v4l2_tuner *v)
{
	struct video_device *dev = video_devdata(file);
	struct rt_device *rt = dev->priv;
	struct rt_device *rt = video_get_drvdata(dev);

	if (v->index > 0)
		return -EINVAL;
@@ -275,7 +275,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
					struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct rt_device *rt = dev->priv;
	struct rt_device *rt = video_get_drvdata(dev);

	rt->curfreq = f->frequency;
	rt_setfreq(rt, rt->curfreq);
@@ -286,7 +286,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
					struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct rt_device *rt = dev->priv;
	struct rt_device *rt = video_get_drvdata(dev);

	f->type = V4L2_TUNER_RADIO;
	f->frequency = rt->curfreq;
@@ -312,7 +312,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
					struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct rt_device *rt = dev->priv;
	struct rt_device *rt = video_get_drvdata(dev);

	switch (ctrl->id) {
	case V4L2_CID_AUDIO_MUTE:
@@ -329,7 +329,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
					struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct rt_device *rt = dev->priv;
	struct rt_device *rt = video_get_drvdata(dev);

	switch (ctrl->id) {
	case V4L2_CID_AUDIO_MUTE:
@@ -437,7 +437,7 @@ static int __init rtrack_init(void)
		return -EBUSY;
	}

	rtrack_radio.priv=&rtrack_unit;
	video_set_drvdata(&rtrack_radio, &rtrack_unit);

	if (video_register_device(&rtrack_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
		release_region(io, 2);
+6 −6
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ static int vidioc_g_tuner (struct file *file, void *priv,
				struct v4l2_tuner *v)
{
	struct video_device *dev = video_devdata(file);
	struct az_device *az = dev->priv;
	struct az_device *az = video_get_drvdata(dev);

	if (v->index > 0)
		return -EINVAL;
@@ -266,7 +266,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
				struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct az_device *az = dev->priv;
	struct az_device *az = video_get_drvdata(dev);

	az->curfreq = f->frequency;
	az_setfreq(az, az->curfreq);
@@ -277,7 +277,7 @@ static int vidioc_g_frequency (struct file *file, void *priv,
				struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct az_device *az = dev->priv;
	struct az_device *az = video_get_drvdata(dev);

	f->type = V4L2_TUNER_RADIO;
	f->frequency = az->curfreq;
@@ -304,7 +304,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
			    struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct az_device *az = dev->priv;
	struct az_device *az = video_get_drvdata(dev);

	switch (ctrl->id) {
		case V4L2_CID_AUDIO_MUTE:
@@ -324,7 +324,7 @@ static int vidioc_s_ctrl (struct file *file, void *priv,
			    struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct az_device *az = dev->priv;
	struct az_device *az = video_get_drvdata(dev);

	switch (ctrl->id) {
		case V4L2_CID_AUDIO_MUTE:
@@ -405,7 +405,7 @@ static int __init aztech_init(void)
	}

	mutex_init(&lock);
	aztech_radio.priv=&aztech_unit;
	video_set_drvdata(&aztech_radio, &aztech_unit);

	if (video_register_device(&aztech_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
		release_region(io,2);
+6 −6
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
					struct v4l2_tuner *v)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_pci_card *card = dev->priv;
	struct gemtek_pci_card *card = video_get_drvdata(dev);

	if (v->index > 0)
		return -EINVAL;
@@ -233,7 +233,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
					struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_pci_card *card = dev->priv;
	struct gemtek_pci_card *card = video_get_drvdata(dev);

	if ( (f->frequency < GEMTEK_PCI_RANGE_LOW) ||
			(f->frequency > GEMTEK_PCI_RANGE_HIGH) )
@@ -248,7 +248,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
					struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_pci_card *card = dev->priv;
	struct gemtek_pci_card *card = video_get_drvdata(dev);

	f->type = V4L2_TUNER_RADIO;
	f->frequency = card->current_frequency;
@@ -273,7 +273,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
					struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_pci_card *card = dev->priv;
	struct gemtek_pci_card *card = video_get_drvdata(dev);

	switch (ctrl->id) {
	case V4L2_CID_AUDIO_MUTE:
@@ -293,7 +293,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
					struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_pci_card *card = dev->priv;
	struct gemtek_pci_card *card = video_get_drvdata(dev);

	switch (ctrl->id) {
	case V4L2_CID_AUDIO_MUTE:
@@ -442,7 +442,7 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci
	}

	card->videodev = devradio;
	devradio->priv = card;
	video_set_drvdata(devradio, card);
	gemtek_pci_mute( card );

	printk( KERN_INFO "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n",
+5 −5
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
			      struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_device *rt = dev->priv;
	struct gemtek_device *rt = video_get_drvdata(dev);

	gemtek_setfreq(rt, f->frequency);

@@ -471,7 +471,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
			      struct v4l2_frequency *f)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_device *rt = dev->priv;
	struct gemtek_device *rt = video_get_drvdata(dev);

	f->type = V4L2_TUNER_RADIO;
	f->frequency = rt->lastfreq;
@@ -496,7 +496,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
			 struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_device *rt = dev->priv;
	struct gemtek_device *rt = video_get_drvdata(dev);

	switch (ctrl->id) {
	case V4L2_CID_AUDIO_MUTE:
@@ -516,7 +516,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
			 struct v4l2_control *ctrl)
{
	struct video_device *dev = video_devdata(file);
	struct gemtek_device *rt = dev->priv;
	struct gemtek_device *rt = video_get_drvdata(dev);

	switch (ctrl->id) {
	case V4L2_CID_AUDIO_MUTE:
@@ -623,7 +623,7 @@ static int __init gemtek_init(void)
		return -EINVAL;
	}

	gemtek_radio.priv = &gemtek_unit;
	video_set_drvdata(&gemtek_radio, &gemtek_unit);

	if (video_register_device(&gemtek_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
		release_region(io, 1);
Loading