Commit 09253b39 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: me4000: remove info macro

This macro relies on a local variable having a specific name.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b3ca977f
...@@ -241,13 +241,16 @@ static const struct comedi_lrange me4000_ao_range = { ...@@ -241,13 +241,16 @@ static const struct comedi_lrange me4000_ao_range = {
static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it) static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it)
{ {
struct me4000_info *info;
struct pci_dev *pci_device = NULL; struct pci_dev *pci_device = NULL;
int result, i; int result, i;
const struct me4000_board *board; const struct me4000_board *board;
/* Allocate private memory */ /* Allocate private memory */
if (alloc_private(dev, sizeof(struct me4000_info)) < 0) result = alloc_private(dev, sizeof(*info));
return -ENOMEM; if (result)
return result;
info = dev->private;
/* /*
* Probe the device to determine what device in the series it is. * Probe the device to determine what device in the series it is.
...@@ -328,6 +331,7 @@ extern unsigned char *xilinx_firm; ...@@ -328,6 +331,7 @@ extern unsigned char *xilinx_firm;
static int xilinx_download(struct comedi_device *dev) static int xilinx_download(struct comedi_device *dev)
{ {
struct me4000_info *info = dev->private;
u32 value = 0; u32 value = 0;
wait_queue_head_t queue; wait_queue_head_t queue;
int idx = 0; int idx = 0;
...@@ -409,6 +413,7 @@ static int xilinx_download(struct comedi_device *dev) ...@@ -409,6 +413,7 @@ static int xilinx_download(struct comedi_device *dev)
static int reset_board(struct comedi_device *dev) static int reset_board(struct comedi_device *dev)
{ {
struct me4000_info *info = dev->private;
unsigned long val; unsigned long val;
int chan; int chan;
...@@ -1392,6 +1397,7 @@ static int me4000_ao_insn_write(struct comedi_device *dev, ...@@ -1392,6 +1397,7 @@ static int me4000_ao_insn_write(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
const struct me4000_board *thisboard = comedi_board(dev); const struct me4000_board *thisboard = comedi_board(dev);
struct me4000_info *info = dev->private;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
int rang = CR_RANGE(insn->chanspec); int rang = CR_RANGE(insn->chanspec);
int aref = CR_AREF(insn->chanspec); int aref = CR_AREF(insn->chanspec);
...@@ -1448,6 +1454,7 @@ static int me4000_ao_insn_read(struct comedi_device *dev, ...@@ -1448,6 +1454,7 @@ static int me4000_ao_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
struct me4000_info *info = dev->private;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
if (insn->n == 0) { if (insn->n == 0) {
...@@ -1609,6 +1616,8 @@ static int me4000_dio_insn_config(struct comedi_device *dev, ...@@ -1609,6 +1616,8 @@ static int me4000_dio_insn_config(struct comedi_device *dev,
static int cnt_reset(struct comedi_device *dev, unsigned int channel) static int cnt_reset(struct comedi_device *dev, unsigned int channel)
{ {
struct me4000_info *info = dev->private;
switch (channel) { switch (channel) {
case 0: case 0:
outb(0x30, info->timer_regbase + ME4000_CNT_CTRL_REG); outb(0x30, info->timer_regbase + ME4000_CNT_CTRL_REG);
...@@ -1638,6 +1647,7 @@ static int cnt_reset(struct comedi_device *dev, unsigned int channel) ...@@ -1638,6 +1647,7 @@ static int cnt_reset(struct comedi_device *dev, unsigned int channel)
static int cnt_config(struct comedi_device *dev, unsigned int channel, static int cnt_config(struct comedi_device *dev, unsigned int channel,
unsigned int mode) unsigned int mode)
{ {
struct me4000_info *info = dev->private;
int tmp = 0; int tmp = 0;
switch (channel) { switch (channel) {
...@@ -1738,7 +1748,7 @@ static int me4000_cnt_insn_read(struct comedi_device *dev, ...@@ -1738,7 +1748,7 @@ static int me4000_cnt_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
struct me4000_info *info = dev->private;
unsigned short tmp; unsigned short tmp;
if (insn->n == 0) if (insn->n == 0)
...@@ -1786,7 +1796,7 @@ static int me4000_cnt_insn_write(struct comedi_device *dev, ...@@ -1786,7 +1796,7 @@ static int me4000_cnt_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
struct me4000_info *info = dev->private;
unsigned short tmp; unsigned short tmp;
if (insn->n == 0) { if (insn->n == 0) {
...@@ -1951,6 +1961,8 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1951,6 +1961,8 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static void me4000_detach(struct comedi_device *dev) static void me4000_detach(struct comedi_device *dev)
{ {
struct me4000_info *info = dev->private;
if (info) { if (info) {
if (info->pci_dev_p) { if (info->pci_dev_p) {
reset_board(dev); reset_board(dev);
......
...@@ -227,8 +227,6 @@ struct me4000_info { ...@@ -227,8 +227,6 @@ struct me4000_info {
unsigned int ao_readback[4]; unsigned int ao_readback[4];
}; };
#define info ((struct me4000_info *)dev->private)
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
Defines for analog input Defines for analog input
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment