Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324575
b: refs/heads/master
c: c6ad306
h: refs/heads/master
i:
  324573: 8883dd8
  324571: b022442
  324567: 80acc09
  324559: c32e8eb
  324543: f5ea9b5
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Aug 17, 2012
1 parent d5f4a15 commit ac90a05
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 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: 93ddbbbcb2fc719d94179f6f8dffbce5e58a8e8f
refs/heads/master: c6ad306b948e78dddcc064a71c41382469d656a3
29 changes: 13 additions & 16 deletions trunk/drivers/staging/comedi/drivers/cb_pcidda.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ static const struct cb_pcidda_board cb_pcidda_boards[] = {
},
};

/*
* Useful for shorthand access to the particular board structure
*/
#define thisboard ((const struct cb_pcidda_board *)dev->board_ptr)

/*
* this structure is for data unique to this hardware driver. If
* several hardware drivers keep similar information in this structure,
Expand All @@ -229,12 +224,6 @@ struct cb_pcidda_private {
u16 eeprom_data[EEPROM_SIZE]; /* software copy of board's eeprom */
};

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

/* static int cb_pcidda_ai_rinsn(struct comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data); */
static int cb_pcidda_ao_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
Expand Down Expand Up @@ -289,21 +278,23 @@ static struct pci_dev *cb_pcidda_find_pci_dev(struct comedi_device *dev,
static int cb_pcidda_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct cb_pcidda_board *thisboard;
struct cb_pcidda_private *devpriv;
struct pci_dev *pcidev;
struct comedi_subdevice *s;
int index;
int ret;

/*
* Allocate the private structure area.
*/
if (alloc_private(dev, sizeof(struct cb_pcidda_private)) < 0)
return -ENOMEM;
ret = alloc_private(dev, sizeof(*devpriv));
if (ret)
return ret;
devpriv = dev->private;

pcidev = cb_pcidda_find_pci_dev(dev, it);
if (!pcidev)
return -EIO;
comedi_set_hw_dev(dev, &pcidev->dev);
thisboard = comedi_board(dev);

/*
* Enable PCI device and request regions.
Expand Down Expand Up @@ -585,6 +576,7 @@ static int cb_pcidda_ao_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct cb_pcidda_private *devpriv = dev->private;
unsigned int command;
unsigned int channel, range;

Expand Down Expand Up @@ -634,6 +626,7 @@ static int cb_pcidda_ao_winsn(struct comedi_device *dev,
/* lowlevel read from eeprom */
static unsigned int cb_pcidda_serial_in(struct comedi_device *dev)
{
struct cb_pcidda_private *devpriv = dev->private;
unsigned int value = 0;
int i;
const int value_width = 16; /* number of bits wide values are */
Expand All @@ -651,6 +644,7 @@ static unsigned int cb_pcidda_serial_in(struct comedi_device *dev)
static void cb_pcidda_serial_out(struct comedi_device *dev, unsigned int value,
unsigned int num_bits)
{
struct cb_pcidda_private *devpriv = dev->private;
int i;

for (i = 1; i <= num_bits; i++) {
Expand All @@ -667,6 +661,7 @@ static void cb_pcidda_serial_out(struct comedi_device *dev, unsigned int value,
static unsigned int cb_pcidda_read_eeprom(struct comedi_device *dev,
unsigned int address)
{
struct cb_pcidda_private *devpriv = dev->private;
unsigned int i;
unsigned int cal2_bits;
unsigned int value;
Expand Down Expand Up @@ -703,6 +698,7 @@ static void cb_pcidda_write_caldac(struct comedi_device *dev,
unsigned int caldac, unsigned int channel,
unsigned int value)
{
struct cb_pcidda_private *devpriv = dev->private;
unsigned int cal2_bits;
unsigned int i;
/* caldacs use 3 bit channel specification */
Expand Down Expand Up @@ -797,6 +793,7 @@ static unsigned int eeprom_fine_byte(unsigned int word)
static void cb_pcidda_calibrate(struct comedi_device *dev, unsigned int channel,
unsigned int range)
{
struct cb_pcidda_private *devpriv = dev->private;
unsigned int coarse_offset, fine_offset, coarse_gain, fine_gain;

/* remember range so we can tell when we need to readjust calibration */
Expand Down

0 comments on commit ac90a05

Please sign in to comment.