Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2714e3e authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: fix return value for insn_bits functions



The comedi_subdevice 'insn_bits' functions return the number of data
elements used to perform the command. Most of the insn_bits functions
return an open coded '2' to indicate this. The same value is available
as 'insn->n'. Return that instead to better indicate what the return
means.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52070660
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ static int acl7225b_do_insn(struct comedi_device *dev,

	data[1] = s->state;

	return 2;
	return insn->n;
}

static int acl7225b_di_insn(struct comedi_device *dev,
@@ -53,7 +53,7 @@ static int acl7225b_di_insn(struct comedi_device *dev,
	data[1] = inb(dev->iobase + (unsigned long)s->private) |
	    (inb(dev->iobase + (unsigned long)s->private + 1) << 8);

	return 2;
	return insn->n;
}

static int acl7225b_attach(struct comedi_device *dev,
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ static int pci6208_ao_rinsn(struct comedi_device *dev,
	 * it was a purely digital output subdevice */
	/* data[1]=s->state; */

/* return 2; */
/* return insn->n; */
/* } */

/* static int pci6208_dio_insn_config(struct comedi_device *dev,
+2 −2
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ static int adl_pci7230_do_insn_bits(struct comedi_device *dev,
		outl((s->state  << 16) & 0xffffffff, dev->iobase + PCI7230_DO);
	}

	return 2;
	return insn->n;
}

static int adl_pci7230_di_insn_bits(struct comedi_device *dev,
@@ -71,7 +71,7 @@ static int adl_pci7230_di_insn_bits(struct comedi_device *dev,
{
	data[1] = inl(dev->iobase + PCI7230_DI) & 0xffffffff;

	return 2;
	return insn->n;
}

static struct pci_dev *adl_pci7230_find_pci(struct comedi_device *dev,
+2 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ static int adl_pci7432_do_insn_bits(struct comedi_device *dev,
		       dev->iobase + PCI7432_DO);
		outl(s->state & 0xffffffff, dev->iobase + PCI7432_DO);
	}
	return 2;
	return insn->n;
}

static int adl_pci7432_di_insn_bits(struct comedi_device *dev,
@@ -79,7 +79,7 @@ static int adl_pci7432_di_insn_bits(struct comedi_device *dev,
	data[1] = inl(dev->iobase + PCI7432_DI) & 0xffffffff;
	printk(KERN_DEBUG "comedi: data1 %8x\n", data[1]);

	return 2;
	return insn->n;
}

static struct pci_dev *adl_pci7432_find_pci(struct comedi_device *dev,
+2 −2
Original line number Diff line number Diff line
@@ -1153,7 +1153,7 @@ static int pci9111_di_insn_bits(struct comedi_device *dev,
	bits = pci9111_di_get_bits();
	data[1] = bits;

	return 2;
	return insn->n;
}

/*  Digital outputs */
@@ -1179,7 +1179,7 @@ static int pci9111_do_insn_bits(struct comedi_device *dev,

	data[1] = bits;

	return 2;
	return insn->n;
}

/*  ------------------------------------------------------------------ */
Loading