From: Jonathan Cameron <jic23@kernel.org>
To: Himanshu Jha <himanshujha199640@gmail.com>
Cc: Slawomir Stepien <sst@poczta.fm>,
lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de,
pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
gregkh@linuxfoundation.org
Subject: Re: [PATCH v5 1/1] staging: iio: adc: ad7280a: use devm_* APIs
Date: Sun, 4 Nov 2018 16:33:47 +0000 [thread overview]
Message-ID: <20181104163347.2e953bad@archlinux> (raw)
In-Reply-To: <20181104145456.GA13773@himanshu-Vostro-3559>
On Sun, 4 Nov 2018 20:24:56 +0530
Himanshu Jha <himanshujha199640@gmail.com> wrote:
> On Sun, Nov 04, 2018 at 11:49:00AM +0100, Slawomir Stepien wrote:
> > devm_* APIs are device managed and make code simpler.
> >
> > Signed-off-by: Slawomir Stepien <sst@poczta.fm>
> > ---
>
> []
>
> > Since v4:
> > * on devm_add_action fail, call the action on error handling
>
> For such a use case, `devm_add_action_or_reset()` seems like a better
> candidate.
Cool. Somehow I'd missed the existence of that. Always thought
such a function would be handy but never actually checked if there
was one ;)
Doh and thanks for the pointer. Easy task for anyone who wants it
is to see where else this is directly applicable in IIO drivers.
The odd bit here is that I'm not entirely sure what 'power up' action
this power down is undoing, so not sure where exactly it should be.
It may just be a catch all for the device being left powered up after
a read sometime earlier. If that's the case I would suggest a comment
making that clear and do it only just before the devm_iio_device_register
(as we don't power up anywhere in probe that I can see and this is the
point at which a power up 'might' occur as the interfaces are exposed.
Jonathan
Jonathan
>
> > + ret = devm_add_action(&spi->dev, ad7280_sw_power_down, st);
> > + if (ret) {
> > + ad7280_sw_power_down(st);
> > + return ret;
> > + }
>
> Also, you can suppress the `1/1` in sunject [PATCH v5 1/1] by passing
> `-N` flag to `git format-patch`.
>
>
next prev parent reply other threads:[~2018-11-05 1:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-04 10:49 [PATCH v5 1/1] staging: iio: adc: ad7280a: use devm_* APIs Slawomir Stepien
2018-11-04 14:54 ` Himanshu Jha
2018-11-04 16:33 ` Jonathan Cameron [this message]
2018-11-09 16:59 ` Slawomir Stepien
2018-11-11 15:01 ` Jonathan Cameron
2018-11-11 16:00 ` Slawomir Stepien
2018-11-06 18:50 ` Slawomir Stepien
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=20181104163347.2e953bad@archlinux \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=himanshujha199640@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=sst@poczta.fm \
/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).