Coccinelle release 1.0.0-rc1
[bpt/coccinelle.git] / tests / video_ver1.c
CommitLineData
34e49164
C
1static int typhoon_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
2{
3 struct typhoon_device *typhoon = dev->priv;
4
5 if (cmd == VIDIOCGTUNER) {
6 struct video_tuner v;
7 if (copy_from_user(v, arg, sizeof(v)) != 0)
8 ret(-EFAULT); else {}
9 if (v.tuner) /* Only 1 tuner */
10 ret(-EINVAL);
11 v.rangelow = 875 * 1600;
12 v.rangehigh = 1080 * 1600;
13 v.flags = VIDEO_TUNER_LOW;
14 v.mode = VIDEO_MODE_AUTO;
15 v.signal = 0xFFFF; /* We can't get the signal strength */
16 strcpy(v.name, "FM");
17 if (copy_to_user(arg, v, sizeof(v)))
18 ret(-EFAULT); else {}
19 ret(0);
20 }/*
21 else if (cmd == VIDIOCSTUNER) {
22 struct video_tuner v;
23 if (copy_from_user(v, arg, sizeof(v)))
24 ret(-EFAULT); else {}
25 if (v.tuner != 0)
26 ret(-EINVAL);
27 ret(0);
28 }
29 else if(cmd == VIDIOCSFREQ) {
30 if (copy_from_user(typhoon->curfreq, arg, sizeof(typhoon->curfreq)))
31 ret(-EFAULT); else {}
32 typhoon_setfreq(typhoon, typhoon->curfreq);
33 ret(0);
34 }*/
35 return -ENOIOCTLCMD;
36}