All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Tiberiu Breana <tiberiu.a.breana@intel.com>, linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 1/2] iio: accel: STK8BA50: suspend sensor on init errors
Date: Sun, 21 Jun 2015 13:53:38 +0100	[thread overview]
Message-ID: <5586B3D2.2080109@kernel.org> (raw)
In-Reply-To: <1434725798-26223-1-git-send-email-tiberiu.a.breana@intel.com>

On 19/06/15 15:56, Tiberiu Breana wrote:
> Put chip in 'suspend' mode in case something goes wrong
> during probe.
> 
> Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com>
Applied to the togreg branch of iio.git - initially pushed
out as testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
> no changes since v1
> ---
>  drivers/iio/accel/stk8ba50.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c
> index 92229bd..9836880 100644
> --- a/drivers/iio/accel/stk8ba50.c
> +++ b/drivers/iio/accel/stk8ba50.c
> @@ -265,7 +265,7 @@ static int stk8ba50_probe(struct i2c_client *client,
>  			STK8BA50_REG_SWRST, STK8BA50_RESET_CMD);
>  	if (ret < 0) {
>  		dev_err(&client->dev, "failed to reset sensor\n");
> -		return ret;
> +		goto err_power_off;
>  	}
>  
>  	/* The default range is +/-2g */
> @@ -277,10 +277,14 @@ static int stk8ba50_probe(struct i2c_client *client,
>  	ret = iio_device_register(indio_dev);
>  	if (ret < 0) {
>  		dev_err(&client->dev, "device_register failed\n");
> -		stk8ba50_set_power(data, STK8BA50_MODE_SUSPEND);
> +		goto err_power_off;
>  	}
>  
>  	return ret;
> +
> +err_power_off:
> +	stk8ba50_set_power(data, STK8BA50_MODE_SUSPEND);
> +	return ret;
>  }
>  
>  static int stk8ba50_remove(struct i2c_client *client)
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in

      parent reply	other threads:[~2015-06-21 12:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 14:56 [PATCH v2 1/2] iio: accel: STK8BA50: suspend sensor on init errors Tiberiu Breana
2015-06-19 14:56 ` [PATCH v2 2/2] iio: accel: Add trigger support for STK8BA50 Tiberiu Breana
2015-06-21 12:58   ` Jonathan Cameron
2015-06-21 12:53 ` 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=5586B3D2.2080109@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=tiberiu.a.breana@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.