Skip to content

Commit b9218f2

Browse files
Hans VerkuilMauro Carvalho Chehab
authored andcommitted
[media] saa6588: rename rds.h to saa6588.h
The naming of the media/rds.h header suggested that it was a generic RDS header, when in fact it is just a saa6588 module API that is internal to the kernel. Rename the header and the struct and defines in it to make this clear. Also removed the header include in radio-si470x.h (not used anymore) and from ioctl-number.txt (it's internal to the kernel and never called from userspace). Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent a519d70 commit b9218f2

6 files changed

Lines changed: 29 additions & 33 deletions

File tree

‎Documentation/ioctl/ioctl-number.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ Code Seq#(hex) Include File Comments
155155
'Q' all linux/soundcard.h
156156
'R' 00-1F linux/random.h conflict!
157157
'R' 01 linux/rfkill.h conflict!
158-
'R' 01-0F media/rds.h conflict!
159158
'R' C0-DF net/bluetooth/rfcomm.h
160159
'S' all linux/cdrom.h conflict!
161160
'S' 80-81 scsi/scsi_ioctl.h conflict!

‎drivers/media/radio/si470x/radio-si470x.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <linux/mutex.h>
3838
#include <media/v4l2-common.h>
3939
#include <media/v4l2-ioctl.h>
40-
#include <media/rds.h>
4140
#include <asm/unaligned.h>
4241

4342

‎drivers/media/video/bt8xx/bttv-driver.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#include <asm/io.h>
5656
#include <asm/byteorder.h>
5757

58-
#include <media/rds.h>
58+
#include <media/saa6588.h>
5959

6060

6161
unsigned int bttv_num; /* number of Bt848s in use */
@@ -3388,15 +3388,15 @@ static int radio_release(struct file *file)
33883388
{
33893389
struct bttv_fh *fh = file->private_data;
33903390
struct bttv *btv = fh->btv;
3391-
struct rds_command cmd;
3391+
struct saa6588_command cmd;
33923392

33933393
v4l2_prio_close(&btv->prio, fh->prio);
33943394
file->private_data = NULL;
33953395
kfree(fh);
33963396

33973397
btv->radio_user--;
33983398

3399-
bttv_call_all(btv, core, ioctl, RDS_CMD_CLOSE, &cmd);
3399+
bttv_call_all(btv, core, ioctl, SAA6588_CMD_CLOSE, &cmd);
34003400

34013401
return 0;
34023402
}
@@ -3523,13 +3523,13 @@ static ssize_t radio_read(struct file *file, char __user *data,
35233523
{
35243524
struct bttv_fh *fh = file->private_data;
35253525
struct bttv *btv = fh->btv;
3526-
struct rds_command cmd;
3526+
struct saa6588_command cmd;
35273527
cmd.block_count = count/3;
35283528
cmd.buffer = data;
35293529
cmd.instance = file;
35303530
cmd.result = -ENODEV;
35313531

3532-
bttv_call_all(btv, core, ioctl, RDS_CMD_READ, &cmd);
3532+
bttv_call_all(btv, core, ioctl, SAA6588_CMD_READ, &cmd);
35333533

35343534
return cmd.result;
35353535
}
@@ -3538,11 +3538,11 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
35383538
{
35393539
struct bttv_fh *fh = file->private_data;
35403540
struct bttv *btv = fh->btv;
3541-
struct rds_command cmd;
3541+
struct saa6588_command cmd;
35423542
cmd.instance = file;
35433543
cmd.event_list = wait;
35443544
cmd.result = -ENODEV;
3545-
bttv_call_all(btv, core, ioctl, RDS_CMD_POLL, &cmd);
3545+
bttv_call_all(btv, core, ioctl, SAA6588_CMD_POLL, &cmd);
35463546

35473547
return cmd.result;
35483548
}

‎drivers/media/video/saa6588.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <linux/wait.h>
3232
#include <asm/uaccess.h>
3333

34-
#include <media/rds.h>
34+
#include <media/saa6588.h>
3535
#include <media/v4l2-device.h>
3636
#include <media/v4l2-chip-ident.h>
3737

@@ -181,7 +181,7 @@ static int block_to_user_buf(struct saa6588 *s, unsigned char __user *user_buf)
181181
return 1;
182182
}
183183

184-
static void read_from_buf(struct saa6588 *s, struct rds_command *a)
184+
static void read_from_buf(struct saa6588 *s, struct saa6588_command *a)
185185
{
186186
unsigned long flags;
187187

@@ -392,25 +392,25 @@ static void saa6588_configure(struct saa6588 *s)
392392
static long saa6588_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
393393
{
394394
struct saa6588 *s = to_saa6588(sd);
395-
struct rds_command *a = arg;
395+
struct saa6588_command *a = arg;
396396

397397
switch (cmd) {
398398
/* --- open() for /dev/radio --- */
399-
case RDS_CMD_OPEN:
399+
case SAA6588_CMD_OPEN:
400400
a->result = 0; /* return error if chip doesn't work ??? */
401401
break;
402402
/* --- close() for /dev/radio --- */
403-
case RDS_CMD_CLOSE:
403+
case SAA6588_CMD_CLOSE:
404404
s->data_available_for_read = 1;
405405
wake_up_interruptible(&s->read_queue);
406406
a->result = 0;
407407
break;
408408
/* --- read() for /dev/radio --- */
409-
case RDS_CMD_READ:
409+
case SAA6588_CMD_READ:
410410
read_from_buf(s, a);
411411
break;
412412
/* --- poll() for /dev/radio --- */
413-
case RDS_CMD_POLL:
413+
case SAA6588_CMD_POLL:
414414
a->result = 0;
415415
if (s->data_available_for_read) {
416416
a->result |= POLLIN | POLLRDNORM;

‎drivers/media/video/saa7134/saa7134-video.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "saa7134-reg.h"
3131
#include "saa7134.h"
3232
#include <media/v4l2-common.h>
33-
#include <media/rds.h>
33+
#include <media/saa6588.h>
3434

3535
/* ------------------------------------------------------------------ */
3636

@@ -1459,7 +1459,7 @@ static int video_release(struct file *file)
14591459
{
14601460
struct saa7134_fh *fh = file->private_data;
14611461
struct saa7134_dev *dev = fh->dev;
1462-
struct rds_command cmd;
1462+
struct saa6588_command cmd;
14631463
unsigned long flags;
14641464

14651465
/* turn off overlay */
@@ -1494,7 +1494,7 @@ static int video_release(struct file *file)
14941494

14951495
saa_call_all(dev, core, s_power, 0);
14961496
if (fh->radio)
1497-
saa_call_all(dev, core, ioctl, RDS_CMD_CLOSE, &cmd);
1497+
saa_call_all(dev, core, ioctl, SAA6588_CMD_CLOSE, &cmd);
14981498

14991499
/* free stuff */
15001500
videobuf_mmap_free(&fh->cap);
@@ -1520,14 +1520,14 @@ static ssize_t radio_read(struct file *file, char __user *data,
15201520
{
15211521
struct saa7134_fh *fh = file->private_data;
15221522
struct saa7134_dev *dev = fh->dev;
1523-
struct rds_command cmd;
1523+
struct saa6588_command cmd;
15241524

15251525
cmd.block_count = count/3;
15261526
cmd.buffer = data;
15271527
cmd.instance = file;
15281528
cmd.result = -ENODEV;
15291529

1530-
saa_call_all(dev, core, ioctl, RDS_CMD_READ, &cmd);
1530+
saa_call_all(dev, core, ioctl, SAA6588_CMD_READ, &cmd);
15311531

15321532
return cmd.result;
15331533
}
@@ -1536,12 +1536,12 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
15361536
{
15371537
struct saa7134_fh *fh = file->private_data;
15381538
struct saa7134_dev *dev = fh->dev;
1539-
struct rds_command cmd;
1539+
struct saa6588_command cmd;
15401540

15411541
cmd.instance = file;
15421542
cmd.event_list = wait;
15431543
cmd.result = -ENODEV;
1544-
saa_call_all(dev, core, ioctl, RDS_CMD_POLL, &cmd);
1544+
saa_call_all(dev, core, ioctl, SAA6588_CMD_POLL, &cmd);
15451545

15461546
return cmd.result;
15471547
}
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
saa6588.c and every driver (e.g. bttv-driver.c) that wants
55
to use the saa6588 module.
66
7-
Instead of having a separate rds.h, I'd prefer to include
8-
this stuff in one of the already existing files like tuner.h
9-
107
(c) 2005 by Hans J. Koch
118
129
This program is free software; you can redistribute it and/or modify
@@ -25,20 +22,21 @@
2522
2623
*/
2724

28-
#ifndef _RDS_H
29-
#define _RDS_H
25+
#ifndef _SAA6588_H
26+
#define _SAA6588_H
3027

31-
struct rds_command {
28+
struct saa6588_command {
3229
unsigned int block_count;
3330
int result;
3431
unsigned char __user *buffer;
3532
struct file *instance;
3633
poll_table *event_list;
3734
};
3835

39-
#define RDS_CMD_OPEN _IOW('R',1,int)
40-
#define RDS_CMD_CLOSE _IOW('R',2,int)
41-
#define RDS_CMD_READ _IOR('R',3,int)
42-
#define RDS_CMD_POLL _IOR('R',4,int)
36+
/* These ioctls are internal to the kernel */
37+
#define SAA6588_CMD_OPEN _IOW('R', 1, int)
38+
#define SAA6588_CMD_CLOSE _IOW('R', 2, int)
39+
#define SAA6588_CMD_READ _IOR('R', 3, int)
40+
#define SAA6588_CMD_POLL _IOR('R', 4, int)
4341

4442
#endif

0 commit comments

Comments
 (0)