From: Jonathan Cameron <jic23@kernel.org>
To: Brian Masney <masneyb@onstation.org>
Cc: linux-iio@vger.kernel.org, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, linux-kernel@vger.kernel.org,
drew.paterson@ams.com
Subject: Re: [PATCH v3 3/9] staging: iio: tsl2x7x: turn chip off if IIO device registration fails
Date: Sat, 12 May 2018 12:16:53 +0100 [thread overview]
Message-ID: <20180512121653.06469001@archlinux> (raw)
In-Reply-To: <20180511001223.12378-4-masneyb@onstation.org>
On Thu, 10 May 2018 20:12:17 -0400
Brian Masney <masneyb@onstation.org> wrote:
> This patch turns the chip off if IIO device registration fails so that
> the error handling mirrors the device remove to make review easier in
> preparation for moving this driver out of staging.
>
> This patch also adds a missing error check in the call to
> tsl2x7x_chip_on() in tsl2x7x_probe().
>
> Signed-off-by: Brian Masney <masneyb@onstation.org>
Applied,
Thanks,
Jonathan
> ---
> drivers/staging/iio/light/tsl2x7x.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c
> index c1e726fc87b7..f5ca5ada0358 100644
> --- a/drivers/staging/iio/light/tsl2x7x.c
> +++ b/drivers/staging/iio/light/tsl2x7x.c
> @@ -1657,10 +1657,13 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
> }
>
> tsl2x7x_defaults(chip);
> - tsl2x7x_chip_on(indio_dev);
> + ret = tsl2x7x_chip_on(indio_dev);
> + if (ret < 0)
> + return ret;
>
> ret = iio_device_register(indio_dev);
> if (ret) {
> + tsl2x7x_chip_off(indio_dev);
> dev_err(&clientp->dev,
> "%s: iio registration failed\n", __func__);
> return ret;
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Brian Masney <masneyb@onstation.org>
Cc: devel@driverdev.osuosl.org, lars@metafoo.de,
linux-iio@vger.kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, pmeerw@pmeerw.net, knaack.h@gmx.de,
drew.paterson@ams.com
Subject: Re: [PATCH v3 3/9] staging: iio: tsl2x7x: turn chip off if IIO device registration fails
Date: Sat, 12 May 2018 12:16:53 +0100 [thread overview]
Message-ID: <20180512121653.06469001@archlinux> (raw)
In-Reply-To: <20180511001223.12378-4-masneyb@onstation.org>
On Thu, 10 May 2018 20:12:17 -0400
Brian Masney <masneyb@onstation.org> wrote:
> This patch turns the chip off if IIO device registration fails so that
> the error handling mirrors the device remove to make review easier in
> preparation for moving this driver out of staging.
>
> This patch also adds a missing error check in the call to
> tsl2x7x_chip_on() in tsl2x7x_probe().
>
> Signed-off-by: Brian Masney <masneyb@onstation.org>
Applied,
Thanks,
Jonathan
> ---
> drivers/staging/iio/light/tsl2x7x.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c
> index c1e726fc87b7..f5ca5ada0358 100644
> --- a/drivers/staging/iio/light/tsl2x7x.c
> +++ b/drivers/staging/iio/light/tsl2x7x.c
> @@ -1657,10 +1657,13 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
> }
>
> tsl2x7x_defaults(chip);
> - tsl2x7x_chip_on(indio_dev);
> + ret = tsl2x7x_chip_on(indio_dev);
> + if (ret < 0)
> + return ret;
>
> ret = iio_device_register(indio_dev);
> if (ret) {
> + tsl2x7x_chip_off(indio_dev);
> dev_err(&clientp->dev,
> "%s: iio registration failed\n", __func__);
> return ret;
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2018-05-12 11:16 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-11 0:12 [PATCH v3 0/9] staging: iio: tsl2x7x: move out of staging Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-11 0:12 ` [PATCH v3 1/9] staging: iio: tsl2x7x: remove unnecessary whitespace Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:15 ` Jonathan Cameron
2018-05-12 11:15 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 2/9] staging: iio: tsl2x7x: use direct returns Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:16 ` Jonathan Cameron
2018-05-12 11:16 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 3/9] staging: iio: tsl2x7x: turn chip off if IIO device registration fails Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:16 ` Jonathan Cameron [this message]
2018-05-12 11:16 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 4/9] staging: iio: tsl2x7x: use macro to populate tsl2X7X_device_info Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:20 ` Jonathan Cameron
2018-05-12 11:20 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 5/9] staging: iio: tsl2x7x: convert to use read_avail Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:20 ` Jonathan Cameron
2018-05-12 11:20 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 6/9] staging: iio: tsl2x7x: correct IIO_EV_INFO_PERIOD values Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:21 ` Jonathan Cameron
2018-05-12 11:21 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 7/9] staging: iio: tsl2x7x: add range checking to tsl2x7x_write_raw Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:23 ` Jonathan Cameron
2018-05-12 11:23 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 8/9] staging: iio: tsl2x7x: rename driver to tsl2772 Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-12 11:25 ` Jonathan Cameron
2018-05-12 11:25 ` Jonathan Cameron
2018-05-11 0:12 ` [PATCH v3 9/9] staging: iio: tsl2x7x/tsl2772: move out of staging Brian Masney
2018-05-11 0:12 ` Brian Masney
2018-05-11 0:32 ` Brian Masney
2018-05-11 0:32 ` Brian Masney
2018-05-12 11:44 ` Jonathan Cameron
2018-05-12 12:36 ` Brian Masney
2018-05-12 12:36 ` Brian Masney
2018-05-12 17:44 ` 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=20180512121653.06469001@archlinux \
--to=jic23@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=drew.paterson@ams.com \
--cc=gregkh@linuxfoundation.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masneyb@onstation.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 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.