aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorTobias Lorenz <tobias.lorenz@gmx.net>2008-09-24 18:33:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:22:24 -0400
commit617f53336c050dfa671d68caff22c1e5d9b2e076 (patch)
tree212a24d66745b0d22cf609e28c9157c719e40ad2 /drivers/media/radio
parent73a529f9a6fee877c4e41f7541b8689dd7561bd7 (diff)
V4L/DVB (9218): si470x: removement of get/set input/audio
This patch removes the unnecessary get/set input/audio functions. The reason is, that the V4L2 specification says, that if input or audio cannot be switched anyway, the functions doesn't need to be implemented. I've tested the new driver with all current radio programs in Debian/testing and found no problems with that. In my opinion, the driver is much cleaner by removing these unnecessary functions. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-si470x.c72
1 files changed, 4 insertions, 68 deletions
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 67d74cecdb67..5920cd306975 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -1216,36 +1216,6 @@ static int si470x_vidioc_querycap(struct file *file, void *priv,
1216 1216
1217 1217
1218/* 1218/*
1219 * si470x_vidioc_g_input - get input
1220 */
1221static int si470x_vidioc_g_input(struct file *file, void *priv,
1222 unsigned int *i)
1223{
1224 *i = 0;
1225
1226 return 0;
1227}
1228
1229
1230/*
1231 * si470x_vidioc_s_input - set input
1232 */
1233static int si470x_vidioc_s_input(struct file *file, void *priv, unsigned int i)
1234{
1235 int retval = 0;
1236
1237 /* safety checks */
1238 if (i != 0)
1239 retval = -EINVAL;
1240
1241 if (retval < 0)
1242 printk(KERN_WARNING DRIVER_NAME
1243 ": set input failed with %d\n", retval);
1244 return retval;
1245}
1246
1247
1248/*
1249 * si470x_vidioc_queryctrl - enumerate control items 1219 * si470x_vidioc_queryctrl - enumerate control items
1250 */ 1220 */
1251static int si470x_vidioc_queryctrl(struct file *file, void *priv, 1221static int si470x_vidioc_queryctrl(struct file *file, void *priv,
@@ -1364,44 +1334,13 @@ done:
1364static int si470x_vidioc_g_audio(struct file *file, void *priv, 1334static int si470x_vidioc_g_audio(struct file *file, void *priv,
1365 struct v4l2_audio *audio) 1335 struct v4l2_audio *audio)
1366{ 1336{
1367 int retval = 0; 1337 /* driver constants */
1368 1338 audio->index = 0;
1369 /* safety checks */
1370 if (audio->index != 0) {
1371 retval = -EINVAL;
1372 goto done;
1373 }
1374
1375 strcpy(audio->name, "Radio"); 1339 strcpy(audio->name, "Radio");
1376 audio->capability = V4L2_AUDCAP_STEREO; 1340 audio->capability = V4L2_AUDCAP_STEREO;
1341 audio->mode = 0;
1377 1342
1378done: 1343 return 0;
1379 if (retval < 0)
1380 printk(KERN_WARNING DRIVER_NAME
1381 ": get audio failed with %d\n", retval);
1382 return retval;
1383}
1384
1385
1386/*
1387 * si470x_vidioc_s_audio - set audio attributes
1388 */
1389static int si470x_vidioc_s_audio(struct file *file, void *priv,
1390 struct v4l2_audio *audio)
1391{
1392 int retval = 0;
1393
1394 /* safety checks */
1395 if (audio->index != 0) {
1396 retval = -EINVAL;
1397 goto done;
1398 }
1399
1400done:
1401 if (retval < 0)
1402 printk(KERN_WARNING DRIVER_NAME
1403 ": set audio failed with %d\n", retval);
1404 return retval;
1405} 1344}
1406 1345
1407 1346
@@ -1613,13 +1552,10 @@ done:
1613 */ 1552 */
1614static const struct v4l2_ioctl_ops si470x_ioctl_ops = { 1553static const struct v4l2_ioctl_ops si470x_ioctl_ops = {
1615 .vidioc_querycap = si470x_vidioc_querycap, 1554 .vidioc_querycap = si470x_vidioc_querycap,
1616 .vidioc_g_input = si470x_vidioc_g_input,
1617 .vidioc_s_input = si470x_vidioc_s_input,
1618 .vidioc_queryctrl = si470x_vidioc_queryctrl, 1555 .vidioc_queryctrl = si470x_vidioc_queryctrl,
1619 .vidioc_g_ctrl = si470x_vidioc_g_ctrl, 1556 .vidioc_g_ctrl = si470x_vidioc_g_ctrl,
1620 .vidioc_s_ctrl = si470x_vidioc_s_ctrl, 1557 .vidioc_s_ctrl = si470x_vidioc_s_ctrl,
1621 .vidioc_g_audio = si470x_vidioc_g_audio, 1558 .vidioc_g_audio = si470x_vidioc_g_audio,
1622 .vidioc_s_audio = si470x_vidioc_s_audio,
1623 .vidioc_g_tuner = si470x_vidioc_g_tuner, 1559 .vidioc_g_tuner = si470x_vidioc_g_tuner,
1624 .vidioc_s_tuner = si470x_vidioc_s_tuner, 1560 .vidioc_s_tuner = si470x_vidioc_s_tuner,
1625 .vidioc_g_frequency = si470x_vidioc_g_frequency, 1561 .vidioc_g_frequency = si470x_vidioc_g_frequency,