summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-31 11:50:50 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-17 14:30:55 +0200
commit5bd8d2abe1edef2559bcfb23e6028df79f81c6e2 (patch)
tree0e6e9b956d7ba02cd2ff00005d0533365d8b3560 /drivers/media/radio
parent[media] radio-timb: convert to the control framework (diff)
downloadlinux-5bd8d2abe1edef2559bcfb23e6028df79f81c6e2.tar.xz
linux-5bd8d2abe1edef2559bcfb23e6028df79f81c6e2.zip
[media] radio-timb: actually load the requested subdevs
For some reason the tuner and dsp subdevs were never actually loaded. Added the relevant code to do that. Also remove bogus calls to video_device_release_empty(). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Richard Röjfors <richard.rojfors@pelagicore.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-timb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index 99694ddf5733..1931ef778fcd 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -126,6 +126,15 @@ static int timbradio_probe(struct platform_device *pdev)
tr->video_dev.v4l2_dev = &tr->v4l2_dev;
+ tr->sd_tuner = v4l2_i2c_new_subdev_board(&tr->v4l2_dev,
+ i2c_get_adapter(pdata->i2c_adapter), pdata->tuner, NULL);
+ tr->sd_dsp = v4l2_i2c_new_subdev_board(&tr->v4l2_dev,
+ i2c_get_adapter(pdata->i2c_adapter), pdata->dsp, NULL);
+ if (tr->sd_tuner == NULL || tr->sd_dsp == NULL)
+ goto err_video_req;
+
+ tr->v4l2_dev.ctrl_handler = tr->sd_dsp->ctrl_handler;
+
err = video_register_device(&tr->video_dev, VFL_TYPE_RADIO, -1);
if (err) {
dev_err(&pdev->dev, "Error reg video\n");
@@ -138,7 +147,6 @@ static int timbradio_probe(struct platform_device *pdev)
return 0;
err_video_req:
- video_device_release_empty(&tr->video_dev);
v4l2_device_unregister(&tr->v4l2_dev);
err:
dev_err(&pdev->dev, "Failed to register: %d\n", err);
@@ -151,10 +159,7 @@ static int timbradio_remove(struct platform_device *pdev)
struct timbradio *tr = platform_get_drvdata(pdev);
video_unregister_device(&tr->video_dev);
- video_device_release_empty(&tr->video_dev);
-
v4l2_device_unregister(&tr->v4l2_dev);
-
return 0;
}