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: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:

gecommit door
Mauro Carvalho Chehab

bovenliggende
e138c592b5
commit
601e9444f2
@@ -232,7 +232,7 @@ static int vidioc_g_tuner (struct file *file, void *priv,
|
||||
struct v4l2_tuner *v)
|
||||
{
|
||||
struct video_device *dev = video_devdata(file);
|
||||
struct radio_device *card=dev->priv;
|
||||
struct radio_device *card = video_get_drvdata(dev);
|
||||
|
||||
if (v->index > 0)
|
||||
return -EINVAL;
|
||||
@@ -303,7 +303,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
|
||||
struct v4l2_frequency *f)
|
||||
{
|
||||
struct video_device *dev = video_devdata(file);
|
||||
struct radio_device *card=dev->priv;
|
||||
struct radio_device *card = video_get_drvdata(dev);
|
||||
|
||||
if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) {
|
||||
dprintk(1, "radio freq (%d.%02d MHz) out of range (%d-%d)\n",
|
||||
@@ -325,7 +325,7 @@ static int vidioc_g_frequency (struct file *file, void *priv,
|
||||
struct v4l2_frequency *f)
|
||||
{
|
||||
struct video_device *dev = video_devdata(file);
|
||||
struct radio_device *card=dev->priv;
|
||||
struct radio_device *card = video_get_drvdata(dev);
|
||||
|
||||
f->type = V4L2_TUNER_RADIO;
|
||||
f->frequency = card->freq;
|
||||
@@ -356,7 +356,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
|
||||
struct v4l2_control *ctrl)
|
||||
{
|
||||
struct video_device *dev = video_devdata(file);
|
||||
struct radio_device *card=dev->priv;
|
||||
struct radio_device *card = video_get_drvdata(dev);
|
||||
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_AUDIO_MUTE:
|
||||
@@ -371,7 +371,7 @@ static int vidioc_s_ctrl (struct file *file, void *priv,
|
||||
struct v4l2_control *ctrl)
|
||||
{
|
||||
struct video_device *dev = video_devdata(file);
|
||||
struct radio_device *card=dev->priv;
|
||||
struct radio_device *card = video_get_drvdata(dev);
|
||||
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_AUDIO_MUTE:
|
||||
@@ -421,7 +421,7 @@ static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_d
|
||||
|
||||
radio_unit.io = pci_resource_start(pdev, 0);
|
||||
mutex_init(&radio_unit.lock);
|
||||
maxiradio_radio.priv = &radio_unit;
|
||||
video_set_drvdata(&maxiradio_radio, &radio_unit);
|
||||
|
||||
if (video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
|
||||
printk("radio-maxiradio: can't register device!");
|
||||
|
Verwijs in nieuw issue
Block a user