Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317157
b: refs/heads/master
c: 9dc5a82
h: refs/heads/master
i:
  317155: 37c88fc
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent a5cbf06 commit 804671b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 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: 01ea83bce2d5219a71a044a084e3cecd6f0ad28e
refs/heads/master: 9dc5a822ea8eaa2397f95aace504fcc657a6cd8b
25 changes: 18 additions & 7 deletions trunk/drivers/staging/comedi/drivers/amplc_pci224.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,6 @@ static const struct pci224_board pci224_boards[] = {
},
};

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

/* 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. */
Expand All @@ -405,15 +400,15 @@ struct pci224_private {
unsigned char intsce;
};

#define devpriv ((struct pci224_private *)dev->private)

/*
* Called from the 'insn_write' function to perform a single write.
*/
static void
pci224_ao_set_data(struct comedi_device *dev, int chan, int range,
unsigned int data)
{
const struct pci224_board *thisboard = comedi_board(dev);
struct pci224_private *devpriv = dev->private;
unsigned short mangled;

/* Store unmangled data for readback. */
Expand Down Expand Up @@ -476,6 +471,7 @@ static int
pci224_ao_insn_read(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct pci224_private *devpriv = dev->private;
int i;
int chan;

Expand Down Expand Up @@ -504,6 +500,7 @@ pci224_cascade_ns_to_timer(int osc_base, unsigned int *d1, unsigned int *d2,
static void pci224_ao_stop(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct pci224_private *devpriv = dev->private;
unsigned long flags;

if (!test_and_clear_bit(AO_CMD_STARTED, &devpriv->state))
Expand Down Expand Up @@ -547,6 +544,7 @@ static void pci224_ao_stop(struct comedi_device *dev,
static void pci224_ao_start(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct pci224_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned long flags;

Expand Down Expand Up @@ -575,6 +573,7 @@ static void pci224_ao_start(struct comedi_device *dev,
static void pci224_ao_handle_fifo(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct pci224_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int num_scans;
unsigned int room;
Expand Down Expand Up @@ -721,6 +720,7 @@ static int
pci224_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
struct pci224_private *devpriv = dev->private;
int err = 0;
unsigned int tmp;

Expand Down Expand Up @@ -991,6 +991,7 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
*/
static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{
struct pci224_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
int range;
unsigned int i, j;
Expand Down Expand Up @@ -1163,6 +1164,8 @@ static void
pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s,
void *data, unsigned int num_bytes, unsigned int chan_index)
{
const struct pci224_board *thisboard = comedi_board(dev);
struct pci224_private *devpriv = dev->private;
struct comedi_async *async = s->async;
short *array = data;
unsigned int length = num_bytes / sizeof(*array);
Expand Down Expand Up @@ -1193,6 +1196,7 @@ pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s,
static irqreturn_t pci224_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
struct pci224_private *devpriv = dev->private;
struct comedi_subdevice *s = &dev->subdevices[0];
struct comedi_cmd *cmd;
unsigned char intstat, valid_intstat;
Expand Down Expand Up @@ -1258,6 +1262,7 @@ static const struct pci224_board
static struct pci_dev *
pci224_find_pci(struct comedi_device *dev, int bus, int slot)
{
const struct pci224_board *thisboard = comedi_board(dev);
struct pci_dev *pci_dev = NULL;

/* Look for matching PCI device. */
Expand All @@ -1279,6 +1284,7 @@ pci224_find_pci(struct comedi_device *dev, int bus, int slot)
continue;
/* Change board_ptr to matched board. */
dev->board_ptr = board_ptr;
thisboard = comedi_board(dev);
} else {
/* Match specific model name. */
if (thisboard->devid != pci_dev->device)
Expand All @@ -1302,6 +1308,7 @@ pci224_find_pci(struct comedi_device *dev, int bus, int slot)

static void pci224_report_attach(struct comedi_device *dev, unsigned int irq)
{
struct pci224_private *devpriv = dev->private;
char tmpbuf[30];

if (irq)
Expand All @@ -1319,6 +1326,8 @@ static void pci224_report_attach(struct comedi_device *dev, unsigned int irq)
static int pci224_attach_common(struct comedi_device *dev,
struct pci_dev *pci_dev, int *options)
{
const struct pci224_board *thisboard = comedi_board(dev);
struct pci224_private *devpriv = dev->private;
struct comedi_subdevice *s;
unsigned int irq;
unsigned n;
Expand Down Expand Up @@ -1516,6 +1525,8 @@ pci224_attach_pci(struct comedi_device *dev, struct pci_dev *pci_dev)

static void pci224_detach(struct comedi_device *dev)
{
struct pci224_private *devpriv = dev->private;

if (dev->irq)
free_irq(dev->irq, dev);
if (dev->subdevices) {
Expand Down

0 comments on commit 804671b

Please sign in to comment.