Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Matt Fornero <matt.fornero@mathworks.com>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: core: Return error for failed read_reg
Date: Sun, 10 Sep 2017 16:26:56 +0100	[thread overview]
Message-ID: <20170910162656.3eb727bd@archlinux> (raw)
In-Reply-To: <1fab0e99-d968-3f26-2bc0-76a677173110@metafoo.de>

On Tue, 5 Sep 2017 17:20:57 +0200
Lars-Peter Clausen <lars@metafoo.de> wrote:

> On 09/05/2017 04:34 PM, Lars-Peter Clausen wrote:
> > From: Matt Fornero <matt.fornero@mathworks.com>
> > 
> > If an IIO device returns an error code for a read access via debugfs, it
> > is currently ignored by the IIO core (other than emitting an error
> > message). Instead, return this error code to user space, so upper layers
> > can detect it correctly.
> > 
> > Signed-off-by: Matt Fornero <matt.fornero@mathworks.com>  
> 
> Sorry, this should also have had:
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> 
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> > ---
> >  drivers/iio/industrialio-core.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> > index 7a5aa127c52e..9c4cfd19b739 100644
> > --- a/drivers/iio/industrialio-core.c
> > +++ b/drivers/iio/industrialio-core.c
> > @@ -310,8 +310,10 @@ static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
> >  	ret = indio_dev->info->debugfs_reg_access(indio_dev,
> >  						  indio_dev->cached_reg_addr,
> >  						  0, &val);
> > -	if (ret)
> > +	if (ret) {
> >  		dev_err(indio_dev->dev.parent, "%s: read failed\n", __func__);
> > +		return ret;
> > +	}
> >  
> >  	len = snprintf(buf, sizeof(buf), "0x%X\n", val);
> >  
> >   
> 


      reply	other threads:[~2017-09-10 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 14:34 [PATCH] iio: core: Return error for failed read_reg Lars-Peter Clausen
2017-09-05 15:20 ` Lars-Peter Clausen
2017-09-10 15:26   ` 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=20170910162656.3eb727bd@archlinux \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=matt.fornero@mathworks.com \
    --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