Skip to content

Commit

Permalink
Staging: comedi: Remove comedi_insn typedef
Browse files Browse the repository at this point in the history
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent ea6d0d4 commit 90035c0
Show file tree
Hide file tree
Showing 150 changed files with 1,143 additions and 1,144 deletions.
7 changes: 3 additions & 4 deletions drivers/staging/comedi/comedi.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,13 @@ enum comedi_support_level {
#define COMEDI_CMD _IOR(CIO, 9, struct comedi_cmd)
#define COMEDI_CMDTEST _IOR(CIO, 10, struct comedi_cmd)
#define COMEDI_INSNLIST _IOR(CIO, 11, comedi_insnlist)
#define COMEDI_INSN _IOR(CIO, 12, comedi_insn)
#define COMEDI_INSN _IOR(CIO, 12, struct comedi_insn)
#define COMEDI_BUFCONFIG _IOR(CIO, 13, comedi_bufconfig)
#define COMEDI_BUFINFO _IOWR(CIO, 14, comedi_bufinfo)
#define COMEDI_POLL _IO(CIO, 15)

/* structures */

typedef struct comedi_insn_struct comedi_insn;
typedef struct comedi_insnlist_struct comedi_insnlist;
typedef struct comedi_chaninfo_struct comedi_chaninfo;
typedef struct comedi_subdinfo_struct comedi_subdinfo;
Expand All @@ -336,7 +335,7 @@ struct comedi_trig {
unsigned int unused[3];
};

struct comedi_insn_struct {
struct comedi_insn {
unsigned int insn;
unsigned int n;
unsigned int *data;
Expand All @@ -347,7 +346,7 @@ struct comedi_insn_struct {

struct comedi_insnlist_struct {
unsigned int n_insns;
comedi_insn *insns;
struct comedi_insn *insns;
};

struct comedi_cmd {
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/comedi/comedi_compat32.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct comedi32_insn_struct {

struct comedi32_insnlist_struct {
unsigned int n_insns;
compat_uptr_t insns; /* 32-bit 'comedi_insn *' */
compat_uptr_t insns; /* 32-bit 'struct comedi_insn *' */
};

/* Handle translated ioctl. */
Expand Down Expand Up @@ -329,7 +329,7 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
}

/* Copy 32-bit insn structure to native insn structure. */
static int get_compat_insn(comedi_insn __user *insn,
static int get_compat_insn(struct comedi_insn __user *insn,
struct comedi32_insn_struct __user *insn32)
{
int err;
Expand Down Expand Up @@ -362,7 +362,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
{
struct combined_insnlist {
comedi_insnlist insnlist;
comedi_insn insn[1];
struct comedi_insn insn[1];
} __user *s;
struct comedi32_insnlist_struct __user *insnlist32;
struct comedi32_insn_struct __user *insn32;
Expand Down Expand Up @@ -410,7 +410,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
/* Handle 32-bit COMEDI_INSN ioctl. */
static int compat_insn(struct file *file, unsigned long arg)
{
comedi_insn __user *insn;
struct comedi_insn __user *insn;
struct comedi32_insn_struct __user *insn32;
int rc;

Expand Down
18 changes: 9 additions & 9 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ static int do_bufinfo_ioctl(struct comedi_device *dev, void *arg)
return 0;
}

static int parse_insn(struct comedi_device *dev, comedi_insn *insn, unsigned int *data,
static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data,
void *file);
/*
* COMEDI_INSNLIST
Expand All @@ -629,7 +629,7 @@ static int parse_insn(struct comedi_device *dev, comedi_insn *insn, unsigned int
static int do_insnlist_ioctl(struct comedi_device *dev, void *arg, void *file)
{
comedi_insnlist insnlist;
comedi_insn *insns = NULL;
struct comedi_insn *insns = NULL;
unsigned int *data = NULL;
int i = 0;
int ret = 0;
Expand All @@ -644,15 +644,15 @@ static int do_insnlist_ioctl(struct comedi_device *dev, void *arg, void *file)
goto error;
}

insns = kmalloc(sizeof(comedi_insn) * insnlist.n_insns, GFP_KERNEL);
insns = kmalloc(sizeof(struct comedi_insn) * insnlist.n_insns, GFP_KERNEL);
if (!insns) {
DPRINTK("kmalloc failed\n");
ret = -ENOMEM;
goto error;
}

if (copy_from_user(insns, insnlist.insns,
sizeof(comedi_insn) * insnlist.n_insns)) {
sizeof(struct comedi_insn) * insnlist.n_insns)) {
DPRINTK("copy_from_user failed\n");
ret = -EFAULT;
goto error;
Expand Down Expand Up @@ -696,7 +696,7 @@ static int do_insnlist_ioctl(struct comedi_device *dev, void *arg, void *file)
return i;
}

static int check_insn_config_length(comedi_insn *insn, unsigned int *data)
static int check_insn_config_length(struct comedi_insn *insn, unsigned int *data)
{
if (insn->n < 1)
return -EINVAL;
Expand Down Expand Up @@ -757,7 +757,7 @@ static int check_insn_config_length(comedi_insn *insn, unsigned int *data)
return -EINVAL;
}

static int parse_insn(struct comedi_device *dev, comedi_insn *insn, unsigned int *data,
static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data,
void *file)
{
struct comedi_subdevice *s;
Expand Down Expand Up @@ -911,15 +911,15 @@ static int parse_insn(struct comedi_device *dev, comedi_insn *insn, unsigned int
* pointer to insn
*
* reads:
* comedi_insn struct at arg
* struct comedi_insn struct at arg
* data (for writes)
*
* writes:
* data (for reads)
*/
static int do_insn_ioctl(struct comedi_device *dev, void *arg, void *file)
{
comedi_insn insn;
struct comedi_insn insn;
unsigned int *data = NULL;
int ret = 0;

Expand All @@ -929,7 +929,7 @@ static int do_insn_ioctl(struct comedi_device *dev, void *arg, void *file)
goto error;
}

if (copy_from_user(&insn, arg, sizeof(comedi_insn))) {
if (copy_from_user(&insn, arg, sizeof(struct comedi_insn))) {
ret = -EFAULT;
goto error;
}
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ struct comedi_subdevice {

unsigned int *chanlist; /* driver-owned chanlist (not used) */

int (*insn_read) (struct comedi_device *, struct comedi_subdevice *, comedi_insn *,
int (*insn_read) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
unsigned int *);
int (*insn_write) (struct comedi_device *, struct comedi_subdevice *, comedi_insn *,
int (*insn_write) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
unsigned int *);
int (*insn_bits) (struct comedi_device *, struct comedi_subdevice *, comedi_insn *,
int (*insn_bits) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
unsigned int *);
int (*insn_config) (struct comedi_device *, struct comedi_subdevice *, comedi_insn *,
int (*insn_config) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
unsigned int *);

int (*do_cmd) (struct comedi_device *, struct comedi_subdevice *);
Expand Down Expand Up @@ -381,7 +381,7 @@ void comedi_set_subdevice_runflags(struct comedi_subdevice *s, unsigned mask,
unsigned bits);
unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s);
int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
struct comedi_insn *insn, unsigned int *data);

/* range stuff */

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/comedi/comedilib.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ unsigned int comedi_get_maxdata(void *dev, unsigned int subdevice, unsigned
int chan);
int comedi_get_n_ranges(void *dev, unsigned int subdevice, unsigned int
chan);
int comedi_do_insn(void *dev, comedi_insn *insn);
int comedi_do_insn(void *dev, struct comedi_insn *insn);
int comedi_poll(void *dev, unsigned int subdev);

/* DEPRECATED functions */
Expand Down Expand Up @@ -165,7 +165,7 @@ unsigned int comedi_get_maxdata(unsigned int minor, unsigned int subdevice, unsi
int chan);
int comedi_get_n_ranges(unsigned int minor, unsigned int subdevice, unsigned int
chan);
int comedi_do_insn(unsigned int minor, comedi_insn *insn);
int comedi_do_insn(unsigned int minor, struct comedi_insn *insn);
int comedi_poll(unsigned int minor, unsigned int subdev);

/* DEPRECATED functions */
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

static int postconfig(struct comedi_device *dev);
static int insn_rw_emulate_bits(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
struct comedi_insn *insn, unsigned int *data);
static void *comedi_recognize(struct comedi_driver * driv, const char *name);
static void comedi_report_boards(struct comedi_driver *driv);
static int poll_invalid(struct comedi_device *dev, struct comedi_subdevice *s);
Expand Down Expand Up @@ -337,15 +337,15 @@ static int poll_invalid(struct comedi_device *dev, struct comedi_subdevice *s)
}

int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
struct comedi_insn *insn, unsigned int *data)
{
return -EINVAL;
}

static int insn_rw_emulate_bits(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
struct comedi_insn *insn, unsigned int *data)
{
comedi_insn new_insn;
struct comedi_insn new_insn;
int ret;
static const unsigned channels_per_bitfield = 32;

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/comedi/drivers/8255.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int subdev_8255_cb(int dir, int port, int data, unsigned long arg)
}

static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
struct comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
Expand All @@ -169,7 +169,7 @@ static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice *
}

static int subdev_8255_insn_config(struct comedi_device *dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
struct comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
unsigned int bits;
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/comedi/drivers/acl7225b.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static struct comedi_driver driver_acl7225b = {
COMEDI_INITCLEANUP(driver_acl7225b);

static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
struct comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
Expand All @@ -72,7 +72,7 @@ static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice *
}

static int acl7225b_di_insn(struct comedi_device *dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
struct comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/comedi/drivers/addi-data/APCI1710_82x54.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
| BYTE_ b_OutputLevel, |
| BYTE_ b_HardwareGateLevel)
INT i_InsnConfig_InitTimer(struct comedi_device *dev,struct comedi_subdevice *s,
comedi_insn *insn,unsigned int *data)
struct comedi_insn *insn,unsigned int *data)
|
+----------------------------------------------------------------------------+
| Task : Configure the Timer (b_TimerNbr) operating mode |
Expand Down Expand Up @@ -220,7 +220,7 @@ INT i_InsnConfig_InitTimer(struct comedi_device *dev,struct comedi_subdevice *s,
*/

INT i_APCI1710_InsnConfigInitTimer(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
struct comedi_insn * insn, unsigned int * data)
{

INT i_ReturnValue = 0;
Expand Down Expand Up @@ -407,7 +407,7 @@ INT i_APCI1710_InsnConfigInitTimer(struct comedi_device * dev, struct comedi_sub
| BYTE_ b_TimerNbr, |
| BYTE_ b_InterruptEnable)
INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev,struct comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Enable OR Disable the Timer (b_TimerNbr) from selected module |
| (b_ModulNbr). You must calling the |
Expand Down Expand Up @@ -450,7 +450,7 @@ i_ReturnValue=insn->n;

INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device * dev,
struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
struct comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_DummyRead;
Expand Down Expand Up @@ -562,7 +562,7 @@ INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device * dev,
| BYTE_ b_ModulNbr, |
| PULONG_ pul_TimerValueArray)
INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev,struct comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the all timer values from selected timer |
| module (b_ModulNbr). |
Expand Down Expand Up @@ -591,7 +591,7 @@ INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev,struct comedi_sub
*/

INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
struct comedi_insn *insn, unsigned int *data)
{
INT i_ReturnValue = 0;
BYTE b_ModulNbr, b_ReadType;
Expand Down Expand Up @@ -669,7 +669,7 @@ INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_su
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnBitsTimer(struct comedi_device *dev,
struct comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read write functions for Timer |
+----------------------------------------------------------------------------+
Expand All @@ -682,7 +682,7 @@ struct comedi_subdevice *s,comedi_insn *insn,unsigned int *data)
*/

INT i_APCI1710_InsnBitsTimer(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
struct comedi_insn * insn, unsigned int * data)
{
BYTE b_BitsType;
INT i_ReturnValue = 0;
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/comedi/drivers/addi-data/APCI1710_82x54.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
* 82X54 TIMER INISIALISATION FUNCTION
*/
INT i_APCI1710_InsnConfigInitTimer(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
struct comedi_insn *insn, unsigned int *data);

INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev,
struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
struct comedi_insn *insn, unsigned int *data);

/*
* 82X54 READ FUNCTION
*/
INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
struct comedi_insn *insn, unsigned int *data);

INT i_APCI1710_InsnBitsTimer(struct comedi_device *dev, struct comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
struct comedi_insn *insn, unsigned int *data);

/*
* 82X54 READ & WRITE FUNCTION
Expand Down
Loading

0 comments on commit 90035c0

Please sign in to comment.