linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Cristina Opriceana <cristina.opriceana@gmail.com>,
	outreachy-kernel@googlegroups.com,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH v2 1/2] Staging: iio: Place driver in sleep mode on error
Date: Sat, 28 Mar 2015 12:13:06 +0000	[thread overview]
Message-ID: <55169AD2.3080400@kernel.org> (raw)
In-Reply-To: <ac0d5b2399b00fe9763c7844c726ffad0a65df99.1426981797.git.cristina.opriceana@gmail.com>

On 22/03/15 00:26, Cristina Opriceana wrote:
> Put device in sleep mode if an error is encountered after
> initialization in order to avoid wasting power.
The patch title should definitely include the name of the driver in question!
Otherwise you'll not generally get reviews from the relevant people.
Staging:iio:hmc5843 Place driver in sleep mode on error during probe.

Also try to cc relevant people and the relevant list.
See MAINTAINERS and you'll notice we have both a list and a
set of designated reviewers who would like to be cc'd on IIO patches.
They may not respond, but if you don't send it to them then they
definitely won't!



Jonathan

> 
> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
> ---
>  drivers/staging/iio/magnetometer/hmc5843_core.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c b/drivers/staging/iio/magnetometer/hmc5843_core.c
> index 0074af2..7de19c2 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_core.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
> @@ -611,7 +611,7 @@ int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
>  	ret = iio_triggered_buffer_setup(indio_dev, NULL,
>  					 hmc5843_trigger_handler, NULL);
>  	if (ret < 0)
> -		return ret;
> +		goto buffer_setup_err;
>  
>  	ret = iio_device_register(indio_dev);
>  	if (ret < 0)
> @@ -619,8 +619,12 @@ int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
>  
>  	return 0;
>  
> +buffer_setup_err:
> +	hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
> +	return ret;
>  buffer_cleanup:
>  	iio_triggered_buffer_cleanup(indio_dev);
> +	hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
>  	return ret;
Single exit path that reverses the ordering of creation.

e.g.
buffer_setup_err:
	hmc_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
buffer_cleanup:
	iio_triggered_buffer_cleanup(indio_dev);
	return ret;
>  }
>  EXPORT_SYMBOL(hmc5843_common_probe);
> 


       reply	other threads:[~2015-03-28 12:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1426981797.git.cristina.opriceana@gmail.com>
     [not found] ` <ac0d5b2399b00fe9763c7844c726ffad0a65df99.1426981797.git.cristina.opriceana@gmail.com>
2015-03-28 12:13   ` Jonathan Cameron [this message]
2015-03-28 13:10     ` [PATCH v2 1/2] Staging: iio: Place driver in sleep mode on error Cristina Georgiana Opriceana
2015-03-28 13:45       ` Jonathan Cameron

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=55169AD2.3080400@kernel.org \
    --to=jic23@kernel.org \
    --cc=cristina.opriceana@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.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;
as well as URLs for NNTP newsgroup(s).