Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324639
b: refs/heads/master
c: a62a176
h: refs/heads/master
i:
  324637: 2d4b214
  324635: cdcf274
  324631: 48bdced
  324623: a3d6b89
  324607: 3e275cd
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent 41167a5 commit 2680cca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90db97d5d9ce05c12f6cd2565b696a53a245e0ca
refs/heads/master: a62a176402dbf01286c815493af3dead836e5bfa
25 changes: 11 additions & 14 deletions trunk/drivers/staging/comedi/drivers/comedi_bond.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct BondedDevice {
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
feel free to suggest moving the variable to the struct comedi_device struct. */
struct Private {
struct comedi_bond_private {
# define MAX_BOARD_NAME 256
char name[MAX_BOARD_NAME];
struct BondedDevice **devs;
Expand All @@ -102,12 +102,6 @@ struct Private {
unsigned nchans;
};

/*
* most drivers define the following macro to make it easy to
* access the private structure.
*/
#define devpriv ((struct Private *)dev->private)

/* DIO devices are slightly special. Although it is possible to
* implement the insn_read/insn_write interface, it is much more
* useful to applications if you implement the insn_bits interface.
Expand All @@ -117,6 +111,7 @@ static int bonding_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct comedi_bond_private *devpriv = dev->private;
#define LSAMPL_BITS (sizeof(unsigned int)*8)
unsigned nchans = LSAMPL_BITS, num_done = 0, i;

Expand Down Expand Up @@ -163,6 +158,7 @@ static int bonding_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct comedi_bond_private *devpriv = dev->private;
int chan = CR_CHAN(insn->chanspec), ret, io_bits = s->io_bits;
unsigned int io;
struct BondedDevice *bdev;
Expand Down Expand Up @@ -216,6 +212,7 @@ static void *Realloc(const void *oldmem, size_t newlen, size_t oldlen)

static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
{
struct comedi_bond_private *devpriv = dev->private;
int i;
struct comedi_device *devs_opened[COMEDI_NUM_BOARD_MINORS];

Expand Down Expand Up @@ -319,20 +316,19 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
static int bonding_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_bond_private *devpriv;
struct comedi_subdevice *s;
int ret;

LOG_MSG("comedi%d\n", dev->minor);

/*
* Allocate the private structure area. alloc_private() is a
* convenient macro defined in comedidev.h.
*/
if (alloc_private(dev, sizeof(struct Private)) < 0)
return -ENOMEM;
ret = alloc_private(dev, sizeof(*devpriv));
if (ret)
return ret;
devpriv = dev->private;

/*
* Setup our bonding from config params.. sets up our Private struct..
* Setup our bonding from config params.. sets up our private struct..
*/
if (!doDevConfig(dev, it))
return -EINVAL;
Expand Down Expand Up @@ -362,6 +358,7 @@ static int bonding_attach(struct comedi_device *dev,

static void bonding_detach(struct comedi_device *dev)
{
struct comedi_bond_private *devpriv = dev->private;
unsigned long devs_closed = 0;

if (devpriv) {
Expand Down

0 comments on commit 2680cca

Please sign in to comment.