static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it)
{
+ struct me4000_info *info;
struct pci_dev *pci_device = NULL;
int result, i;
const struct me4000_board *board;
/* Allocate private memory */
- if (alloc_private(dev, sizeof(struct me4000_info)) < 0)
- return -ENOMEM;
+ result = alloc_private(dev, sizeof(*info));
+ if (result)
+ return result;
+ info = dev->private;
/*
* Probe the device to determine what device in the series it is.
static int xilinx_download(struct comedi_device *dev)
{
+ struct me4000_info *info = dev->private;
u32 value = 0;
wait_queue_head_t queue;
int idx = 0;
static int reset_board(struct comedi_device *dev)
{
+ struct me4000_info *info = dev->private;
unsigned long val;
int chan;
struct comedi_insn *insn, unsigned int *data)
{
const struct me4000_board *thisboard = comedi_board(dev);
+ struct me4000_info *info = dev->private;
int chan = CR_CHAN(insn->chanspec);
int rang = CR_RANGE(insn->chanspec);
int aref = CR_AREF(insn->chanspec);
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
+ struct me4000_info *info = dev->private;
int chan = CR_CHAN(insn->chanspec);
if (insn->n == 0) {
static int cnt_reset(struct comedi_device *dev, unsigned int channel)
{
+ struct me4000_info *info = dev->private;
+
switch (channel) {
case 0:
outb(0x30, info->timer_regbase + ME4000_CNT_CTRL_REG);
static int cnt_config(struct comedi_device *dev, unsigned int channel,
unsigned int mode)
{
+ struct me4000_info *info = dev->private;
int tmp = 0;
switch (channel) {
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
-
+ struct me4000_info *info = dev->private;
unsigned short tmp;
if (insn->n == 0)
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
-
+ struct me4000_info *info = dev->private;
unsigned short tmp;
if (insn->n == 0) {
static void me4000_detach(struct comedi_device *dev)
{
+ struct me4000_info *info = dev->private;
+
if (info) {
if (info->pci_dev_p) {
reset_board(dev);