aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-09-14 06:41:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-26 09:47:28 -0400
commitec6f4328108f1c83d5ac907c0d978fa886ef9627 (patch)
tree5e964c9a73b5ab2cb839af53ebebfe18f5bb28c9 /drivers/media/radio
parentd88aab53bd267c9fb0b0451e9acae68091703eab (diff)
[media] v4l2: make vidioc_s_freq_hw_seek const
Write-only ioctls should have a const argument in the ioctl op. Do this conversion for vidioc_s_freq_hw_seek. Adding const for write-only ioctls was decided during the 2012 Media Workshop. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-mr800.c2
-rw-r--r--drivers/media/radio/radio-tea5777.c32
-rw-r--r--drivers/media/radio/radio-wl1273.c2
-rw-r--r--drivers/media/radio/si470x/radio-si470x-common.c4
-rw-r--r--drivers/media/radio/wl128x/fmdrv_v4l2.c2
5 files changed, 22 insertions, 20 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 3182b26d6efa..720bf0da599c 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -348,7 +348,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
348} 348}
349 349
350static int vidioc_s_hw_freq_seek(struct file *file, void *priv, 350static int vidioc_s_hw_freq_seek(struct file *file, void *priv,
351 struct v4l2_hw_freq_seek *seek) 351 const struct v4l2_hw_freq_seek *seek)
352{ 352{
353 static u8 buf[8] = { 353 static u8 buf[8] = {
354 0x3d, 0x32, 0x0f, 0x08, 0x3d, 0x32, 0x0f, 0x08 354 0x3d, 0x32, 0x0f, 0x08, 0x3d, 0x32, 0x0f, 0x08
diff --git a/drivers/media/radio/radio-tea5777.c b/drivers/media/radio/radio-tea5777.c
index ef8289829794..c1a2ea6e87a3 100644
--- a/drivers/media/radio/radio-tea5777.c
+++ b/drivers/media/radio/radio-tea5777.c
@@ -385,59 +385,61 @@ static int vidioc_s_frequency(struct file *file, void *priv,
385} 385}
386 386
387static int vidioc_s_hw_freq_seek(struct file *file, void *fh, 387static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
388 struct v4l2_hw_freq_seek *a) 388 const struct v4l2_hw_freq_seek *a)
389{ 389{
390 struct radio_tea5777 *tea = video_drvdata(file); 390 struct radio_tea5777 *tea = video_drvdata(file);
391 unsigned long timeout; 391 unsigned long timeout;
392 u32 rangelow = a->rangelow;
393 u32 rangehigh = a->rangehigh;
392 int i, res, spacing; 394 int i, res, spacing;
393 u32 orig_freq; 395 u32 orig_freq;
394 396
395 if (a->tuner || a->wrap_around) 397 if (a->tuner || a->wrap_around)
396 return -EINVAL; 398 return -EINVAL;
397 399
398 if (a->rangelow || a->rangehigh) { 400 if (rangelow || rangehigh) {
399 for (i = 0; i < ARRAY_SIZE(bands); i++) { 401 for (i = 0; i < ARRAY_SIZE(bands); i++) {
400 if (i == BAND_AM && !tea->has_am) 402 if (i == BAND_AM && !tea->has_am)
401 continue; 403 continue;
402 if (bands[i].rangelow >= a->rangelow && 404 if (bands[i].rangelow >= rangelow &&
403 bands[i].rangehigh <= a->rangehigh) 405 bands[i].rangehigh <= rangehigh)
404 break; 406 break;
405 } 407 }
406 if (i == ARRAY_SIZE(bands)) 408 if (i == ARRAY_SIZE(bands))
407 return -EINVAL; /* No matching band found */ 409 return -EINVAL; /* No matching band found */
408 410
409 tea->band = i; 411 tea->band = i;
410 if (tea->freq < a->rangelow || tea->freq > a->rangehigh) { 412 if (tea->freq < rangelow || tea->freq > rangehigh) {
411 tea->freq = clamp(tea->freq, a->rangelow, 413 tea->freq = clamp(tea->freq, rangelow,
412 a->rangehigh); 414 rangehigh);
413 res = radio_tea5777_set_freq(tea); 415 res = radio_tea5777_set_freq(tea);
414 if (res) 416 if (res)
415 return res; 417 return res;
416 } 418 }
417 } else { 419 } else {
418 a->rangelow = bands[tea->band].rangelow; 420 rangelow = bands[tea->band].rangelow;
419 a->rangehigh = bands[tea->band].rangehigh; 421 rangehigh = bands[tea->band].rangehigh;
420 } 422 }
421 423
422 spacing = (tea->band == BAND_AM) ? (5 * 16) : (200 * 16); /* kHz */ 424 spacing = (tea->band == BAND_AM) ? (5 * 16) : (200 * 16); /* kHz */
423 orig_freq = tea->freq; 425 orig_freq = tea->freq;
424 426
425 tea->write_reg |= TEA5777_W_PROGBLIM_MASK; 427 tea->write_reg |= TEA5777_W_PROGBLIM_MASK;
426 if (tea->seek_rangelow != a->rangelow) { 428 if (tea->seek_rangelow != rangelow) {
427 tea->write_reg &= ~TEA5777_W_UPDWN_MASK; 429 tea->write_reg &= ~TEA5777_W_UPDWN_MASK;
428 tea->freq = a->rangelow; 430 tea->freq = rangelow;
429 res = radio_tea5777_set_freq(tea); 431 res = radio_tea5777_set_freq(tea);
430 if (res) 432 if (res)
431 goto leave; 433 goto leave;
432 tea->seek_rangelow = a->rangelow; 434 tea->seek_rangelow = rangelow;
433 } 435 }
434 if (tea->seek_rangehigh != a->rangehigh) { 436 if (tea->seek_rangehigh != rangehigh) {
435 tea->write_reg |= TEA5777_W_UPDWN_MASK; 437 tea->write_reg |= TEA5777_W_UPDWN_MASK;
436 tea->freq = a->rangehigh; 438 tea->freq = rangehigh;
437 res = radio_tea5777_set_freq(tea); 439 res = radio_tea5777_set_freq(tea);
438 if (res) 440 if (res)
439 goto leave; 441 goto leave;
440 tea->seek_rangehigh = a->rangehigh; 442 tea->seek_rangehigh = rangehigh;
441 } 443 }
442 tea->write_reg &= ~TEA5777_W_PROGBLIM_MASK; 444 tea->write_reg &= ~TEA5777_W_PROGBLIM_MASK;
443 445
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index a22ad1c1f3d5..71968a610734 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1682,7 +1682,7 @@ static int wl1273_fm_vidioc_s_frequency(struct file *file, void *priv,
1682#define WL1273_DEFAULT_SEEK_LEVEL 7 1682#define WL1273_DEFAULT_SEEK_LEVEL 7
1683 1683
1684static int wl1273_fm_vidioc_s_hw_freq_seek(struct file *file, void *priv, 1684static int wl1273_fm_vidioc_s_hw_freq_seek(struct file *file, void *priv,
1685 struct v4l2_hw_freq_seek *seek) 1685 const struct v4l2_hw_freq_seek *seek)
1686{ 1686{
1687 struct wl1273_device *radio = video_get_drvdata(video_devdata(file)); 1687 struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
1688 struct wl1273_core *core = radio->core; 1688 struct wl1273_core *core = radio->core;
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index 9bb65e170d99..74a5c901471f 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -296,7 +296,7 @@ int si470x_set_freq(struct si470x_device *radio, unsigned int freq)
296 * si470x_set_seek - set seek 296 * si470x_set_seek - set seek
297 */ 297 */
298static int si470x_set_seek(struct si470x_device *radio, 298static int si470x_set_seek(struct si470x_device *radio,
299 struct v4l2_hw_freq_seek *seek) 299 const struct v4l2_hw_freq_seek *seek)
300{ 300{
301 int band, retval; 301 int band, retval;
302 unsigned int freq; 302 unsigned int freq;
@@ -701,7 +701,7 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv,
701 * si470x_vidioc_s_hw_freq_seek - set hardware frequency seek 701 * si470x_vidioc_s_hw_freq_seek - set hardware frequency seek
702 */ 702 */
703static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv, 703static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
704 struct v4l2_hw_freq_seek *seek) 704 const struct v4l2_hw_freq_seek *seek)
705{ 705{
706 struct si470x_device *radio = video_drvdata(file); 706 struct si470x_device *radio = video_drvdata(file);
707 707
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index db2248ee9498..f816ea68e469 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -403,7 +403,7 @@ static int fm_v4l2_vidioc_s_freq(struct file *file, void *priv,
403 403
404/* Set hardware frequency seek. If current mode is NOT RX, set it RX. */ 404/* Set hardware frequency seek. If current mode is NOT RX, set it RX. */
405static int fm_v4l2_vidioc_s_hw_freq_seek(struct file *file, void *priv, 405static int fm_v4l2_vidioc_s_hw_freq_seek(struct file *file, void *priv,
406 struct v4l2_hw_freq_seek *seek) 406 const struct v4l2_hw_freq_seek *seek)
407{ 407{
408 struct fmdev *fmdev = video_drvdata(file); 408 struct fmdev *fmdev = video_drvdata(file);
409 int ret; 409 int ret;