mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: "Amin GATTOUT" <amin.gattout@gmail.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>
Cc: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: at91_adc: use const char * for DT string property
Date: Wed, 22 Jul 2026 14:47:08 -0500	[thread overview]
Message-ID: <3314a217-5e6c-44cb-af8e-1327c375c4dd@baylibre.com> (raw)
In-Reply-To: <20260722-master-v1-1-ab0591897e4b@gmail.com>

On 7/22/26 2:39 PM, Amin GATTOUT wrote:
> Declare the local variable as const char * and remove the unnecessary cast
> when passing it to of_property_read_string().
> 
> Signed-off-by: Amin GATTOUT <amin.gattout@gmail.com>
> ---
>  drivers/iio/adc/at91_adc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index f610ad729bf3..0ac74ad92fca 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -988,7 +988,7 @@ static int at91_adc_probe(struct platform_device *pdev)
>  	struct iio_dev *idev;
>  	struct at91_adc_state *st;
>  	u32 reg, prop;
> -	char *s;
> +	const char *s;
>  
>  	idev = devm_iio_device_alloc(&pdev->dev, sizeof(struct at91_adc_state));
>  	if (!idev)
> @@ -1023,7 +1023,7 @@ static int at91_adc_probe(struct platform_device *pdev)
>  
>  	st->res = st->caps->high_res_bits;
>  	if (st->caps->low_res_bits &&
> -	    !of_property_read_string(node, "atmel,adc-use-res", (const char **)&s)
> +	    !of_property_read_string(node, "atmel,adc-use-res", &s)
>  	    && !strcmp(s, "lowres"))
>  		st->res = st->caps->low_res_bits;
>  
> 
> ---
> base-commit: 248951ddc14de84de3910f9b13f51491a8cd91df
> change-id: 20260722-master-23179d7c00c4
> 
> Best regards,

Makes sense.

Reviewed-by: David Lechner <dlechner@baylibre.com>

Although perhaps could be simplified instead by using
of_property_match_string().

  reply	other threads:[~2026-07-22 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 19:39 Amin GATTOUT
2026-07-22 19:47 ` David Lechner [this message]
2026-07-25 23:22   ` 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=3314a217-5e6c-44cb-af8e-1327c375c4dd@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=amin.gattout@gmail.com \
    --cc=andy@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=nuno.sa@analog.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®