diff options
author | Tobias Lorenz <tobias.lorenz@gmx.net> | 2008-09-24 18:17:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 16:20:43 -0400 |
commit | 374ab68615592043dadbbe54f3beadf9556704f8 (patch) | |
tree | 5d5d6e5577a3d67e4b88b23676e015145c500271 /drivers/media/radio | |
parent | 7b31b57a37ab694b9693a0359bf8ed0967188533 (diff) |
V4L/DVB (9213): si470x: module_param access rights
This patch mainly adds correct module_param access rights. Also there
are a lot of small coding style enhancements and some corrections of the
variable references in module_param.
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.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c index f6cedcd3ab97..3efc08f424fd 100644 --- a/drivers/media/radio/radio-si470x.c +++ b/drivers/media/radio/radio-si470x.c | |||
@@ -141,9 +141,9 @@ | |||
141 | /* USB Device ID List */ | 141 | /* USB Device ID List */ |
142 | static struct usb_device_id si470x_usb_driver_id_table[] = { | 142 | static struct usb_device_id si470x_usb_driver_id_table[] = { |
143 | /* Silicon Labs USB FM Radio Reference Design */ | 143 | /* Silicon Labs USB FM Radio Reference Design */ |
144 | { USB_DEVICE_AND_INTERFACE_INFO(0x10c4, 0x818a, USB_CLASS_HID, 0, 0) }, | 144 | { USB_DEVICE_AND_INTERFACE_INFO(0x10c4, 0x818a, USB_CLASS_HID, 0, 0) }, |
145 | /* ADS/Tech FM Radio Receiver (formerly Instant FM Music) */ | 145 | /* ADS/Tech FM Radio Receiver (formerly Instant FM Music) */ |
146 | { USB_DEVICE_AND_INTERFACE_INFO(0x06e1, 0xa155, USB_CLASS_HID, 0, 0) }, | 146 | { USB_DEVICE_AND_INTERFACE_INFO(0x06e1, 0xa155, USB_CLASS_HID, 0, 0) }, |
147 | /* Terminating entry */ | 147 | /* Terminating entry */ |
148 | { } | 148 | { } |
149 | }; | 149 | }; |
@@ -157,7 +157,7 @@ MODULE_DEVICE_TABLE(usb, si470x_usb_driver_id_table); | |||
157 | 157 | ||
158 | /* Radio Nr */ | 158 | /* Radio Nr */ |
159 | static int radio_nr = -1; | 159 | static int radio_nr = -1; |
160 | module_param(radio_nr, int, 0); | 160 | module_param(radio_nr, int, 0444); |
161 | MODULE_PARM_DESC(radio_nr, "Radio Nr"); | 161 | MODULE_PARM_DESC(radio_nr, "Radio Nr"); |
162 | 162 | ||
163 | /* Spacing (kHz) */ | 163 | /* Spacing (kHz) */ |
@@ -165,42 +165,42 @@ MODULE_PARM_DESC(radio_nr, "Radio Nr"); | |||
165 | /* 1: 100 kHz (Europe, Japan) */ | 165 | /* 1: 100 kHz (Europe, Japan) */ |
166 | /* 2: 50 kHz */ | 166 | /* 2: 50 kHz */ |
167 | static unsigned short space = 2; | 167 | static unsigned short space = 2; |
168 | module_param(space, ushort, 0); | 168 | module_param(space, ushort, 0444); |
169 | MODULE_PARM_DESC(radio_nr, "Spacing: 0=200kHz 1=100kHz *2=50kHz*"); | 169 | MODULE_PARM_DESC(space, "Spacing: 0=200kHz 1=100kHz *2=50kHz*"); |
170 | 170 | ||
171 | /* Bottom of Band (MHz) */ | 171 | /* Bottom of Band (MHz) */ |
172 | /* 0: 87.5 - 108 MHz (USA, Europe)*/ | 172 | /* 0: 87.5 - 108 MHz (USA, Europe)*/ |
173 | /* 1: 76 - 108 MHz (Japan wide band) */ | 173 | /* 1: 76 - 108 MHz (Japan wide band) */ |
174 | /* 2: 76 - 90 MHz (Japan) */ | 174 | /* 2: 76 - 90 MHz (Japan) */ |
175 | static unsigned short band = 1; | 175 | static unsigned short band = 1; |
176 | module_param(band, ushort, 0); | 176 | module_param(band, ushort, 0444); |
177 | MODULE_PARM_DESC(radio_nr, "Band: 0=87.5..108MHz *1=76..108MHz* 2=76..90MHz"); | 177 | MODULE_PARM_DESC(band, "Band: 0=87.5..108MHz *1=76..108MHz* 2=76..90MHz"); |
178 | 178 | ||
179 | /* De-emphasis */ | 179 | /* De-emphasis */ |
180 | /* 0: 75 us (USA) */ | 180 | /* 0: 75 us (USA) */ |
181 | /* 1: 50 us (Europe, Australia, Japan) */ | 181 | /* 1: 50 us (Europe, Australia, Japan) */ |
182 | static unsigned short de = 1; | 182 | static unsigned short de = 1; |
183 | module_param(de, ushort, 0); | 183 | module_param(de, ushort, 0444); |
184 | MODULE_PARM_DESC(radio_nr, "De-emphasis: 0=75us *1=50us*"); | 184 | MODULE_PARM_DESC(de, "De-emphasis: 0=75us *1=50us*"); |
185 | 185 | ||
186 | /* USB timeout */ | 186 | /* USB timeout */ |
187 | static unsigned int usb_timeout = 500; | 187 | static unsigned int usb_timeout = 500; |
188 | module_param(usb_timeout, uint, 0); | 188 | module_param(usb_timeout, uint, 0644); |
189 | MODULE_PARM_DESC(usb_timeout, "USB timeout (ms): *500*"); | 189 | MODULE_PARM_DESC(usb_timeout, "USB timeout (ms): *500*"); |
190 | 190 | ||
191 | /* Tune timeout */ | 191 | /* Tune timeout */ |
192 | static unsigned int tune_timeout = 3000; | 192 | static unsigned int tune_timeout = 3000; |
193 | module_param(tune_timeout, uint, 0); | 193 | module_param(tune_timeout, uint, 0644); |
194 | MODULE_PARM_DESC(tune_timeout, "Tune timeout: *3000*"); | 194 | MODULE_PARM_DESC(tune_timeout, "Tune timeout: *3000*"); |
195 | 195 | ||
196 | /* Seek timeout */ | 196 | /* Seek timeout */ |
197 | static unsigned int seek_timeout = 5000; | 197 | static unsigned int seek_timeout = 5000; |
198 | module_param(seek_timeout, uint, 0); | 198 | module_param(seek_timeout, uint, 0644); |
199 | MODULE_PARM_DESC(seek_timeout, "Seek timeout: *5000*"); | 199 | MODULE_PARM_DESC(seek_timeout, "Seek timeout: *5000*"); |
200 | 200 | ||
201 | /* RDS buffer blocks */ | 201 | /* RDS buffer blocks */ |
202 | static unsigned int rds_buf = 100; | 202 | static unsigned int rds_buf = 100; |
203 | module_param(rds_buf, uint, 0); | 203 | module_param(rds_buf, uint, 0444); |
204 | MODULE_PARM_DESC(rds_buf, "RDS buffer entries: *100*"); | 204 | MODULE_PARM_DESC(rds_buf, "RDS buffer entries: *100*"); |
205 | 205 | ||
206 | /* RDS maximum block errors */ | 206 | /* RDS maximum block errors */ |
@@ -209,7 +209,7 @@ static unsigned short max_rds_errors = 1; | |||
209 | /* 1 means 1-2 errors requiring correction (used by original USBRadio.exe) */ | 209 | /* 1 means 1-2 errors requiring correction (used by original USBRadio.exe) */ |
210 | /* 2 means 3-5 errors requiring correction */ | 210 | /* 2 means 3-5 errors requiring correction */ |
211 | /* 3 means 6+ errors or errors in checkword, correction not possible */ | 211 | /* 3 means 6+ errors or errors in checkword, correction not possible */ |
212 | module_param(max_rds_errors, ushort, 0); | 212 | module_param(max_rds_errors, ushort, 0644); |
213 | MODULE_PARM_DESC(max_rds_errors, "RDS maximum block errors: *1*"); | 213 | MODULE_PARM_DESC(max_rds_errors, "RDS maximum block errors: *1*"); |
214 | 214 | ||
215 | /* RDS poll frequency */ | 215 | /* RDS poll frequency */ |
@@ -218,7 +218,7 @@ static unsigned int rds_poll_time = 40; | |||
218 | /* 50 is used by radio-cadet */ | 218 | /* 50 is used by radio-cadet */ |
219 | /* 75 should be okay */ | 219 | /* 75 should be okay */ |
220 | /* 80 is the usual RDS receive interval */ | 220 | /* 80 is the usual RDS receive interval */ |
221 | module_param(rds_poll_time, uint, 0); | 221 | module_param(rds_poll_time, uint, 0644); |
222 | MODULE_PARM_DESC(rds_poll_time, "RDS poll time (ms): *40*"); | 222 | MODULE_PARM_DESC(rds_poll_time, "RDS poll time (ms): *40*"); |
223 | 223 | ||
224 | 224 | ||
@@ -1588,6 +1588,10 @@ done: | |||
1588 | return retval; | 1588 | return retval; |
1589 | } | 1589 | } |
1590 | 1590 | ||
1591 | |||
1592 | /* | ||
1593 | * si470x_ioctl_ops - video device ioctl operations | ||
1594 | */ | ||
1591 | static const struct v4l2_ioctl_ops si470x_ioctl_ops = { | 1595 | static const struct v4l2_ioctl_ops si470x_ioctl_ops = { |
1592 | .vidioc_querycap = si470x_vidioc_querycap, | 1596 | .vidioc_querycap = si470x_vidioc_querycap, |
1593 | .vidioc_g_input = si470x_vidioc_g_input, | 1597 | .vidioc_g_input = si470x_vidioc_g_input, |
@@ -1604,14 +1608,15 @@ static const struct v4l2_ioctl_ops si470x_ioctl_ops = { | |||
1604 | .vidioc_s_hw_freq_seek = si470x_vidioc_s_hw_freq_seek, | 1608 | .vidioc_s_hw_freq_seek = si470x_vidioc_s_hw_freq_seek, |
1605 | }; | 1609 | }; |
1606 | 1610 | ||
1611 | |||
1607 | /* | 1612 | /* |
1608 | * si470x_viddev_tamples - video device interface | 1613 | * si470x_viddev_template - video device interface |
1609 | */ | 1614 | */ |
1610 | static struct video_device si470x_viddev_template = { | 1615 | static struct video_device si470x_viddev_template = { |
1611 | .fops = &si470x_fops, | 1616 | .fops = &si470x_fops, |
1612 | .ioctl_ops = &si470x_ioctl_ops, | ||
1613 | .name = DRIVER_NAME, | 1617 | .name = DRIVER_NAME, |
1614 | .release = video_device_release, | 1618 | .release = video_device_release, |
1619 | .ioctl_ops = &si470x_ioctl_ops, | ||
1615 | }; | 1620 | }; |
1616 | 1621 | ||
1617 | 1622 | ||