linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Daniel Baluta <daniel.baluta@intel.com>,
	Cristina Opriceana <cristina.opriceana@gmail.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: industrialio-buffer: Fix iio_buffer_poll return value
Date: Sat, 8 Aug 2015 16:44:32 +0100	[thread overview]
Message-ID: <55C623E0.4090802@kernel.org> (raw)
In-Reply-To: <CAEnQRZBOd_5O+8-pWOJLDD-sycYmcn5cbkFctH4Fr73R21cr-Q@mail.gmail.com>

On 03/08/15 11:44, Daniel Baluta wrote:
> On Mon, Aug 3, 2015 at 1:37 PM, Cristina Opriceana
> <cristina.opriceana@gmail.com> wrote:
>> Change return value to 0 if no device is bound since
>> unsigned int cannot support negative error codes.
>>
>> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
> 
> Fixes: f18e7a068 ("iio: Return -ENODEV for file operations if the
> device has been unregistered")
> 
I've applied a variant of this to the the fixes-togreg branch.
The docs aren't there yet so this is going to make for some messy
merging.  We can fix the docs once the fix has worked it's way through.

Jonathan
>> ---
>>  drivers/iio/industrialio-buffer.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
>> index faed6ef..e8e87cf 100644
>> --- a/drivers/iio/industrialio-buffer.c
>> +++ b/drivers/iio/industrialio-buffer.c
>> @@ -155,7 +155,9 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
>>   *             a wait queue
>>   *
>>   * Return: (POLLIN | POLLRDNORM) if data is available for reading
>> - *        or 0 for other cases
>> + *        and 0 for other cases, e.g. no device is bound or no
>> + *        hardware fifo flush could be triggered.
>> + *
>>   */
>>  unsigned int iio_buffer_poll(struct file *filp,
>>                              struct poll_table_struct *wait)
>> @@ -164,7 +166,7 @@ unsigned int iio_buffer_poll(struct file *filp,
>>         struct iio_buffer *rb = indio_dev->buffer;
>>
>>         if (!indio_dev->info)
>> -               return -ENODEV;
>> +               return 0;
>>
>>         poll_wait(filp, &rb->pollq, wait);
>>         if (iio_buffer_ready(indio_dev, rb, rb->watermark, 0))
>> --
>> 1.9.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2015-08-08 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 10:37 [PATCH] iio: industrialio-buffer: Fix iio_buffer_poll return value Cristina Opriceana
2015-08-03 10:44 ` Daniel Baluta
2015-08-08 15:44   ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55C623E0.4090802@kernel.org \
    --to=jic23@kernel.org \
    --cc=cristina.opriceana@gmail.com \
    --cc=daniel.baluta@intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).