From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<johan@kernel.org>, <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v2 5/6] iio: light: lm3533-als: use iio_device_set_parent() to assign parent
Date: Sat, 6 Jun 2020 16:46:31 +0100 [thread overview]
Message-ID: <20200606164631.25cd78a6@archlinux> (raw)
In-Reply-To: <20200603114023.175102-6-alexandru.ardelean@analog.com>
On Wed, 3 Jun 2020 14:40:22 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> This assignment is the more peculiar as it assigns the parent of the
> platform-device's device (i.e. pdev->dev.parent) as the IIO device's
> parent.
>
> Since the devm_iio_device_alloc() [now] assigns the device argument as the
> default parent (and since this is the more common case), for cases
> where the parent needs to be different, the iio_device_set_parent helper
> should be used.
>
> That makes things a bit more obvious about the new behavior of
> devm_iio_device_alloc() and makes it clearer that iio_device_set_parent()
> should be used.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied.
Thanks,
Jonathan
> ---
> drivers/iio/light/lm3533-als.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c
> index bc196c212881..8a621244dd01 100644
> --- a/drivers/iio/light/lm3533-als.c
> +++ b/drivers/iio/light/lm3533-als.c
> @@ -852,7 +852,7 @@ static int lm3533_als_probe(struct platform_device *pdev)
> indio_dev->channels = lm3533_als_channels;
> indio_dev->num_channels = ARRAY_SIZE(lm3533_als_channels);
> indio_dev->name = dev_name(&pdev->dev);
> - indio_dev->dev.parent = pdev->dev.parent;
> + iio_device_set_parent(indio_dev, pdev->dev.parent);
> indio_dev->modes = INDIO_DIRECT_MODE;
>
> als = iio_priv(indio_dev);
next prev parent reply other threads:[~2020-06-06 15:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 11:40 [PATCH v2 0/6] iio: core: pass parent device as parameter during allocation Alexandru Ardelean
2020-06-03 11:40 ` [PATCH v2 1/6] " Alexandru Ardelean
2020-06-06 15:24 ` Jonathan Cameron
2020-06-03 11:40 ` [PATCH v2 2/6] iio: core: add iio_device_set_parent() helper Alexandru Ardelean
2020-06-06 15:25 ` Jonathan Cameron
2020-06-03 11:40 ` [PATCH v2 4/6] iio: remove left-over comments about parent assignment Alexandru Ardelean
2020-06-06 15:46 ` Jonathan Cameron
2020-06-03 11:40 ` [PATCH v2 5/6] iio: light: lm3533-als: use iio_device_set_parent() to assign parent Alexandru Ardelean
2020-06-06 15:46 ` Jonathan Cameron [this message]
2020-06-03 11:40 ` [PATCH v2 6/6] iio: remove left-over parent assignments Alexandru Ardelean
2020-06-06 16:05 ` Jonathan Cameron
2020-06-11 6:52 ` Ardelean, Alexandru
2020-06-14 12:14 ` Jonathan Cameron
2020-06-03 11:41 ` [PATCH v2 0/6] iio: core: pass parent device as parameter during allocation Ardelean, Alexandru
2020-06-04 17:34 ` Jonathan Cameron
2020-06-06 16:02 ` Jonathan Cameron
2020-06-08 6:37 ` Alexandru Ardelean
2020-06-08 11:10 ` 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=20200606164631.25cd78a6@archlinux \
--to=jic23@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=andy.shevchenko@gmail.com \
--cc=johan@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).