linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Alexandru Ardelean <ardeleanalex@gmail.com>
Cc: Tian Tao <tiantao6@hisilicon.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	"Hennerich, Michael" <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio <linux-iio@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>
Subject: Re: [PATCH] iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of()
Date: Thu, 20 Aug 2020 16:05:44 +0300	[thread overview]
Message-ID: <CAHp75VdqrczNjsgR7JZTsK8+=RmgFopGJ1VZdD4+BYxBHMHukg@mail.gmail.com> (raw)
In-Reply-To: <CA+U=DsojNXFxT812=i-0ceRGUV3gJXhMMb-ungP=DO166jjZMA@mail.gmail.com>

On Thu, Aug 20, 2020 at 12:10 PM Alexandru Ardelean
<ardeleanalex@gmail.com> wrote:
> On Thu, Aug 20, 2020 at 6:04 AM Tian Tao <tiantao6@hisilicon.com> wrote:
> >
> > Use kobj_to_dev() instead of container_of()

> Good point.
>
> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

...

> > -       struct device *dev = container_of(kobj, struct device, kobj);
> > +       struct device *dev = kobj_to_dev(kobj);
> >         struct iio_dev *indio_dev = dev_to_iio_dev(dev);

And now this can be one line since dev is not used separately.

> >         struct adi_axi_adc_state *st = iio_priv(indio_dev);
> >         struct adi_axi_adc_conv *conv = &st->client->conv;

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-08-20 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20  3:01 [PATCH] iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of() Tian Tao
2020-08-20  9:09 ` Alexandru Ardelean
2020-08-20 13:05   ` Andy Shevchenko [this message]
2020-08-20 13:07     ` Andy Shevchenko
2020-08-22 10: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='CAHp75VdqrczNjsgR7JZTsK8+=RmgFopGJ1VZdD4+BYxBHMHukg@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=ardeleanalex@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tiantao6@hisilicon.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 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).