Re: [PATCH 3/4] staging: comedi: ni_pcidio: Add comedi_poll support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 09, 2012 at 03:47:32PM +0000, Ian Abbott wrote:
> This patch is ported over by me (Ian Abbott) from the out-of-tree Comedi
> git repository at "git://comedi.org/git/comedi/comedi.git".
> 
> The original patch is by Nicholas Nell.
> 
> The patch adds support for the COMEDI_POLL ioctl to the ni_pcidio
> driver.
> 
> Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
> Cc: Nicholas Nell <nicholas.nell@xxxxxxxxxxxx>
> ---
>  drivers/staging/comedi/drivers/ni_pcidio.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c
> index 5145bf1..c258059 100644
> --- a/drivers/staging/comedi/drivers/ni_pcidio.c
> +++ b/drivers/staging/comedi/drivers/ni_pcidio.c
> @@ -483,12 +483,28 @@ void ni_pcidio_event(struct comedi_device *dev, struct comedi_subdevice *s)
>  	comedi_event(dev, s);
>  }
>  
> +static int ni_pcidio_poll(struct comedi_device *dev, struct comedi_subdevice *s)
> +{
> +	unsigned long flags_dev, flags_mite;
> +	int count;
> +
> +	spin_lock_irqsave(&dev->spinlock, flags_dev);
> +	spin_lock_irqsave(&devpriv->mite_channel_lock, flags_mite);

We disabled IRQs on the line before.  No need to disable them a
second time.

regards,
dan carpenter

> +	if (devpriv->di_mite_chan)
> +		mite_sync_input_dma(devpriv->di_mite_chan, s->async);
> +	spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags_mite);
> +	count = s->async->buf_write_count - s->async->buf_read_count;
> +	spin_unlock_irqrestore(&dev->spinlock, flags_dev);
> +	return count;
> +}
> +

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux