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

V4L/DVB (8788): v4l: replace video_get_drvdata(video_devdata(filp)) with video_drvdata(filp)



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

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bfa8a273
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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;
@@ -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)
@@ -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;
@@ -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:
@@ -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:
@@ -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;
@@ -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;
+5 −10
Original line number Diff line number Diff line
@@ -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;
@@ -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);
@@ -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;
@@ -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:
@@ -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:
+5 −10
Original line number Diff line number Diff line
@@ -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;
@@ -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);
@@ -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;
@@ -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:
@@ -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:
+5 −10
Original line number Diff line number Diff line
@@ -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;
@@ -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) )
@@ -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;
@@ -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:
@@ -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:
+4 −8
Original line number Diff line number Diff line
@@ -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);

@@ -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;
@@ -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:
@@ -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:
Loading