From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C636A349B19 for ; Wed, 22 Jul 2026 19:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784749637; cv=none; b=rIlaIhqNXEIlFbOneJ2Lza2VpPSywA0SPWPnsdsqED6QZw+R+N9wmpHvksvVczXde6CdKGsmukfex663int3OQQOcfektYyW5cvT/MKBEsKo/9cGFwAVDDZ5VIXPNi/3SuScygO//SuABGIsqZJVdtp8U49miOwu+mXrtGE4C2I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784749637; c=relaxed/simple; bh=6sv+FiPVq0EsrHhhvuJ6MuEHxA23D5VzY0gov0LBjSk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BpolwNbdpw6zzWCa1sPEszL8Q9GNpHseHSxR3Qk5Scmgmo+xNdMpvVbhHkFsd/BgUIcgXpGc48eU9Lw6AfUaObLd1p5x8IG/ToeRdFU/sm+7O3XxhP+4jbzaPf8DcyIpGwk9JKGx+DAoxVUqONV9q4rTTmsAEr52DoaSr9n8UwE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=Y6O9vrQ8; arc=none smtp.client-ip=209.85.161.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="Y6O9vrQ8" Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-6a31c05e092so4071245eaf.0 for ; Wed, 22 Jul 2026 12:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1784749635; x=1785354435; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=25lW1olxCrNiyANiOxoyrikBwf6oNATnngWHhqIjQZk=; b=Y6O9vrQ8puh4kO+yJYlku87fuJLcCp2TR5Uw03yf0hObS0uYFE19P4Gzh0HWK2M+dF Qay6cok5TxaQrFKzSR8NPEtSqt1kCE9zbvwJNyzbQm21XbzKY0uPZqJn+THyZ+3VHRlk DchlEeiEs9VWw7rBno0vkHyJVmRzvsIgeECBSyzLJrCuoZ/4jX4ZyiWVr4TKuq/yy4tj pbjayQOx0uR69uEwvLfScLFJnVz6cqdN76biMFQPoSbkI2R2f9RJ2bIolrOof7f853Vd RPJ7cJgSdlq40UYt2bv3bIXIilARxmLKuSvvGSuIj0t7l1oZnpLySEZhtGqkoNSl7Cal Wxpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784749635; x=1785354435; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=25lW1olxCrNiyANiOxoyrikBwf6oNATnngWHhqIjQZk=; b=f9L4bKXtJaYdNAaiHBayoK9bReOlBKkdB9gSvpm18XXq5PZaM9zZJqSPM5V86baZHj vBHieSwlpNUNAMCtoBDbT999+hJcUQTDQea4z8UYkEtFmgY3ZaPkqefHvGzpEjxgPAUt IIzl3NGQ1BLARtxjno2MwQFY0NkZQnK8BfpjEp5H+SarV6y8nJcuDr1Um1Lv42Nbghqg 7kuwqWW1/pUwGgZLIhuOGMxbumr3oYzzd2X6EEX+zs9pEk6e1yHyJ6ypi6Zbb+oN9m5Y PV+Lcfitws50WxGaC/fjZ4KhUxAzcV8Ia7zxVxqO9EojRhcQZuGUN/RWDsQTt8flH91I 3RqQ== X-Forwarded-Encrypted: i=1; AHgh+RqaxxcLaYKfBsxI1iAKYBZ5KwR/T4Q3h+vjyYqcoUAfVSiMEVAdaUVMlvnU5oEhq0eprZAjAUnWTAxQ+vw=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5Rs4Crn3Sr+jTepXPOVVAs3vKh5CBZKgzVBVbWVFXSC+qZmYW eeR9cbftx5p9zltR2J/VRyGxyDvxPocj8EVMeAWYEAlGb5ihqwu9wFpzDMisEK0VXvU= X-Gm-Gg: AR+sD11P1LWYvu+m0niaWVRDRparZqrj2p1eY1fVHHlRytSgHT2sbakUSHTUayCtXg+ IrUL6VwcOtsWUVSL0BnWKYC4qxFOtK1ebr2dD1relgkUyYri00tG16A3r11mCneV7cZuPD5keqb vpFDr3KV6Um6sBGr29SXZ0MyuztnpfbgkxAjDDqkOLXExeTwduh6OEYh5jFFd8puhK9DMY/RuQB mt4nDC8Tsa3sJa8KH7mMAEPwQCaMnO8ubp5hMa4tJ/E0u3ApDBEZy7hSUzuRuNl8bNmDOZn0F4I OUWffyG65gcAjb9g//kc0YualFJM6wrShvJybQKJipN/DDNEvyBzJ2WNkH/LOXHt/HbcKOEtJGU ohSj3HnYuwFJTQWmUAS24pKyzHutBzTGWfMsax7VCXAMrjnelcmEvOT/4sXBuoqEHMqqwK81hET yTmF8UOlDg4r2hs+nFD8nnssjPI5UifdhZEOyCDU774zj6wDGXgA== X-Received: by 2002:a05:6820:a28b:20b0:6aa:c665:e73c with SMTP id 006d021491bc7-6aac665f3a6mr1085425eaf.71.1784749629880; Wed, 22 Jul 2026 12:47:09 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:d067:7d1:556a:2be5? ([2600:8803:e7e4:500:d067:7d1:556a:2be5]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6aa76233e99sm2189786eaf.2.2026.07.22.12.47.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jul 2026 12:47:09 -0700 (PDT) Message-ID: <3314a217-5e6c-44cb-af8e-1327c375c4dd@baylibre.com> Date: Wed, 22 Jul 2026 14:47:08 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] iio: adc: at91_adc: use const char * for DT string property To: Amin GATTOUT , Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260722-master-v1-1-ab0591897e4b@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <20260722-master-v1-1-ab0591897e4b@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > --- > 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 Although perhaps could be simplified instead by using of_property_match_string().