aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-31 05:50:50 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-17 08:30:55 -0400
commit5bd8d2abe1edef2559bcfb23e6028df79f81c6e2 (patch)
tree0e6e9b956d7ba02cd2ff00005d0533365d8b3560
parent38be65abfff07fdbbc4d956b997c214ec9005960 (diff)
[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>
-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)
126 126
127 tr->video_dev.v4l2_dev = &tr->v4l2_dev; 127 tr->video_dev.v4l2_dev = &tr->v4l2_dev;
128 128
129 tr->sd_tuner = v4l2_i2c_new_subdev_board(&tr->v4l2_dev,
130 i2c_get_adapter(pdata->i2c_adapter), pdata->tuner, NULL);
131 tr->sd_dsp = v4l2_i2c_new_subdev_board(&tr->v4l2_dev,
132 i2c_get_adapter(pdata->i2c_adapter), pdata->dsp, NULL);
133 if (tr->sd_tuner == NULL || tr->sd_dsp == NULL)
134 goto err_video_req;
135
136 tr->v4l2_dev.ctrl_handler = tr->sd_dsp->ctrl_handler;
137
129 err = video_register_device(&tr->video_dev, VFL_TYPE_RADIO, -1); 138 err = video_register_device(&tr->video_dev, VFL_TYPE_RADIO, -1);
130 if (err) { 139 if (err) {
131 dev_err(&pdev->dev, "Error reg video\n"); 140 dev_err(&pdev->dev, "Error reg video\n");
@@ -138,7 +147,6 @@ static int timbradio_probe(struct platform_device *pdev)
138 return 0; 147 return 0;
139 148
140err_video_req: 149err_video_req:
141 video_device_release_empty(&tr->video_dev);
142 v4l2_device_unregister(&tr->v4l2_dev); 150 v4l2_device_unregister(&tr->v4l2_dev);
143err: 151err:
144 dev_err(&pdev->dev, "Failed to register: %d\n", err); 152 dev_err(&pdev->dev, "Failed to register: %d\n", err);
@@ -151,10 +159,7 @@ static int timbradio_remove(struct platform_device *pdev)
151 struct timbradio *tr = platform_get_drvdata(pdev); 159 struct timbradio *tr = platform_get_drvdata(pdev);
152 160
153 video_unregister_device(&tr->video_dev); 161 video_unregister_device(&tr->video_dev);
154 video_device_release_empty(&tr->video_dev);
155
156 v4l2_device_unregister(&tr->v4l2_dev); 162 v4l2_device_unregister(&tr->v4l2_dev);
157
158 return 0; 163 return 0;
159} 164}
160 165