mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Cosmin Tanislav <cosmin.tanislav@analog.com>,
	Dumitru Ceclan <mitrutzceclan@gmail.com>,
	Guillaume Ranquet <granquet@baylibre.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Michael Walle <michael@walle.cc>, Nuno Sa <nuno.sa@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 9/8] iio: adc: ad7124: Benefit of dev = indio_dev->dev.parent in ad7124_parse_channel_config()
Date: Thu, 6 Mar 2025 00:10:13 +0000	[thread overview]
Message-ID: <20250306001013.7cd5d00c@jic23-huawei> (raw)
In-Reply-To: <v7l2skqj65vbku3ebjsfndfj3atl6iqpodamios2do6q6kcagf@whmuir6fwede>

On Tue, 4 Mar 2025 10:41:09 +0100
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:

> Since commit a6eaf02b8274 ("iio: adc: ad7124: Switch from of specific to
> fwnode based property handling") the function
> ad7124_parse_channel_config() has a parameter `dev` that holds
> the value `indio_dev->dev.parent`. Make use of that to shorten two code
> lines.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> Hello,
> 
> this is a patch opportunity I noticed while backporting my original
> series to an older kernel to please my customer.
> I chose to sneak it into the series in the hope to not offend maintainer
> tools :-)
Leads to b4 getting rather confused, but doing the right thing in the end.

Applied.

Thanks,

Jonathan

> 
> Best regards
> Uwe
> 
>  drivers/iio/adc/ad7124.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c
> index 5ab0d3e48c43..53b274ca42ac 100644
> --- a/drivers/iio/adc/ad7124.c
> +++ b/drivers/iio/adc/ad7124.c
> @@ -1061,12 +1061,12 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,
>  	/* Add one for temperature */
>  	st->num_channels = min(num_channels + 1, AD7124_MAX_CHANNELS);
>  
> -	chan = devm_kcalloc(indio_dev->dev.parent, st->num_channels,
> +	chan = devm_kcalloc(dev, st->num_channels,
>  			    sizeof(*chan), GFP_KERNEL);
>  	if (!chan)
>  		return -ENOMEM;
>  
> -	channels = devm_kcalloc(indio_dev->dev.parent, st->num_channels, sizeof(*channels),
> +	channels = devm_kcalloc(dev, st->num_channels, sizeof(*channels),
>  				GFP_KERNEL);
>  	if (!channels)
>  		return -ENOMEM;


  reply	other threads:[~2025-03-06  0:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04  9:41 Uwe Kleine-König
2025-03-06  0:10 ` Jonathan Cameron [this message]
2025-03-06  8:31   ` Uwe Kleine-König

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=20250306001013.7cd5d00c@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=cosmin.tanislav@analog.com \
    --cc=granquet@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=mitrutzceclan@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=u.kleine-koenig@baylibre.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

all inboxes | Powered by JetHome®