mirror of https://gitee.com/openkylin/linux.git
staging: comedi: pcmuio: tidy up switch_page()
All the I/O ports are left unlocked in the driver so the 'pagelock' in the private data is not necessary. The paranoia sanity checks are also unnecessary, Remove them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f45a1f26ea
commit
46317da71e
|
@ -182,8 +182,6 @@ struct pcmuio_subdev_private {
|
||||||
|
|
||||||
struct pcmuio_private {
|
struct pcmuio_private {
|
||||||
struct {
|
struct {
|
||||||
/* current page and lock */
|
|
||||||
unsigned char pagelock;
|
|
||||||
/* shadow of POLx registers */
|
/* shadow of POLx registers */
|
||||||
unsigned char pol[NUM_PAGED_REGS];
|
unsigned char pol[NUM_PAGED_REGS];
|
||||||
/* shadow of ENABx registers */
|
/* shadow of ENABx registers */
|
||||||
|
@ -312,19 +310,7 @@ static int pcmuio_dio_insn_config(struct comedi_device *dev,
|
||||||
|
|
||||||
static void switch_page(struct comedi_device *dev, int asic, int page)
|
static void switch_page(struct comedi_device *dev, int asic, int page)
|
||||||
{
|
{
|
||||||
const struct pcmuio_board *board = comedi_board(dev);
|
outb(PCMUIO_PAGE(page),
|
||||||
struct pcmuio_private *devpriv = dev->private;
|
|
||||||
|
|
||||||
if (asic < 0 || asic >= board->num_asics)
|
|
||||||
return; /* paranoia */
|
|
||||||
if (page < 0 || page >= NUM_PAGES)
|
|
||||||
return; /* more paranoia */
|
|
||||||
|
|
||||||
devpriv->asics[asic].pagelock &= ~PCMUIO_PAGE_MASK;
|
|
||||||
devpriv->asics[asic].pagelock |= PCMUIO_PAGE(page);
|
|
||||||
|
|
||||||
/* now write out the shadow register */
|
|
||||||
outb(devpriv->asics[asic].pagelock,
|
|
||||||
dev->iobase + ASIC_IOSIZE * asic + PCMUIO_PAGE_LOCK_REG);
|
dev->iobase + ASIC_IOSIZE * asic + PCMUIO_PAGE_LOCK_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue