Commit 6fef4907 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] tlg2300: embed video_device instead of allocating it

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarHuang Shijie <shijie8@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8f082946
...@@ -118,7 +118,7 @@ struct radio_data { ...@@ -118,7 +118,7 @@ struct radio_data {
int users; int users;
unsigned int is_radio_streaming; unsigned int is_radio_streaming;
int pre_emphasis; int pre_emphasis;
struct video_device *fm_dev; struct video_device fm_dev;
}; };
#define DVB_SBUF_NUM 4 #define DVB_SBUF_NUM 4
......
...@@ -369,31 +369,23 @@ static struct video_device poseidon_fm_template = { ...@@ -369,31 +369,23 @@ static struct video_device poseidon_fm_template = {
.name = "Telegent-Radio", .name = "Telegent-Radio",
.fops = &poseidon_fm_fops, .fops = &poseidon_fm_fops,
.minor = -1, .minor = -1,
.release = video_device_release, .release = video_device_release_empty,
.ioctl_ops = &poseidon_fm_ioctl_ops, .ioctl_ops = &poseidon_fm_ioctl_ops,
}; };
int poseidon_fm_init(struct poseidon *p) int poseidon_fm_init(struct poseidon *p)
{ {
struct video_device *fm_dev; struct video_device *vfd = &p->radio_data.fm_dev;
int err;
fm_dev = vdev_init(p, &poseidon_fm_template); *vfd = poseidon_fm_template;
if (fm_dev == NULL) vfd->v4l2_dev = &p->v4l2_dev;
return -ENOMEM; video_set_drvdata(vfd, p);
p->radio_data.fm_dev = fm_dev;
set_frequency(p, TUNER_FREQ_MIN_FM); set_frequency(p, TUNER_FREQ_MIN_FM);
err = video_register_device(fm_dev, VFL_TYPE_RADIO, -1); return video_register_device(vfd, VFL_TYPE_RADIO, -1);
if (err < 0) {
video_device_release(fm_dev);
return err;
}
return 0;
} }
int poseidon_fm_exit(struct poseidon *p) int poseidon_fm_exit(struct poseidon *p)
{ {
destroy_video_device(&p->radio_data.fm_dev);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment