Skip to content

Commit

Permalink
V4L/DVB (8788): v4l: replace video_get_drvdata(video_devdata(filp)) w…
Browse files Browse the repository at this point in the history
…ith video_drvdata(filp)

Use the new video_drvdata(filp) function where it is safe to do so.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
hverkuil authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent bfa8a27 commit c170ecf
Show file tree
Hide file tree
Showing 26 changed files with 160 additions and 310 deletions.
14 changes: 7 additions & 7 deletions drivers/media/radio/dsbr100.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);

if (v->index > 0)
return -EINVAL;
Expand Down Expand Up @@ -306,7 +306,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);

radio->curfreq = f->frequency;
if (dsbr100_setfreq(radio, radio->curfreq)==-1)
Expand All @@ -317,7 +317,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);

f->type = V4L2_TUNER_RADIO;
f->frequency = radio->curfreq;
Expand All @@ -342,7 +342,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand All @@ -355,7 +355,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand Down Expand Up @@ -405,7 +405,7 @@ static int vidioc_s_audio(struct file *file, void *priv,

static int usb_dsbr100_open(struct inode *inode, struct file *file)
{
struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);

lock_kernel();
radio->users = 1;
Expand All @@ -424,7 +424,7 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file)

static int usb_dsbr100_close(struct inode *inode, struct file *file)
{
struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);

if (!radio)
return -ENODEV;
Expand Down
15 changes: 5 additions & 10 deletions drivers/media/radio/radio-aimslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ static int vidioc_querycap(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);

if (v->index > 0)
return -EINVAL;
Expand All @@ -274,8 +273,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);

rt->curfreq = f->frequency;
rt_setfreq(rt, rt->curfreq);
Expand All @@ -285,8 +283,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);

f->type = V4L2_TUNER_RADIO;
f->frequency = rt->curfreq;
Expand All @@ -311,8 +308,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand All @@ -328,8 +324,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand Down
15 changes: 5 additions & 10 deletions drivers/media/radio/radio-aztech.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ static int vidioc_querycap (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);

if (v->index > 0)
return -EINVAL;
Expand Down Expand Up @@ -265,8 +264,7 @@ static int vidioc_s_audio (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);

az->curfreq = f->frequency;
az_setfreq(az, az->curfreq);
Expand All @@ -276,8 +274,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);

f->type = V4L2_TUNER_RADIO;
f->frequency = az->curfreq;
Expand All @@ -303,8 +300,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand All @@ -323,8 +319,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand Down
15 changes: 5 additions & 10 deletions drivers/media/radio/radio-gemtek-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ static int vidioc_querycap(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);

if (v->index > 0)
return -EINVAL;
Expand All @@ -232,8 +231,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);

if ( (f->frequency < GEMTEK_PCI_RANGE_LOW) ||
(f->frequency > GEMTEK_PCI_RANGE_HIGH) )
Expand All @@ -247,8 +245,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);

f->type = V4L2_TUNER_RADIO;
f->frequency = card->current_frequency;
Expand All @@ -272,8 +269,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand All @@ -292,8 +288,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand Down
12 changes: 4 additions & 8 deletions drivers/media/radio/radio-gemtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
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 = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);

gemtek_setfreq(rt, f->frequency);

Expand All @@ -470,8 +469,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);

f->type = V4L2_TUNER_RADIO;
f->frequency = rt->lastfreq;
Expand All @@ -495,8 +493,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand All @@ -515,8 +512,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand Down
15 changes: 5 additions & 10 deletions drivers/media/radio/radio-maestro.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ static int vidioc_querycap(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

if (v->index > 0)
return -EINVAL;
Expand Down Expand Up @@ -243,8 +242,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

if (f->frequency < FREQ_LO || f->frequency > FREQ_HI)
return -EINVAL;
Expand All @@ -255,8 +253,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

f->type = V4L2_TUNER_RADIO;
f->frequency = BITS2FREQ(radio_bits_get(card));
Expand All @@ -281,8 +278,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand All @@ -295,8 +291,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
register u16 io = card->io;
register u16 omask = inw(io + IO_MASK);

Expand Down
15 changes: 5 additions & 10 deletions drivers/media/radio/radio-maxiradio.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ static int vidioc_querycap (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

if (v->index > 0)
return -EINVAL;
Expand Down Expand Up @@ -302,8 +301,7 @@ static int vidioc_s_audio (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) {
dprintk(1, "radio freq (%d.%02d MHz) out of range (%d-%d)\n",
Expand All @@ -324,8 +322,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

f->type = V4L2_TUNER_RADIO;
f->frequency = card->freq;
Expand Down Expand Up @@ -355,8 +352,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand All @@ -370,8 +366,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
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 = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
Expand Down
Loading

0 comments on commit c170ecf

Please sign in to comment.