From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F361C14A8B; Sat, 8 Mar 2025 16:33:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741451615; cv=none; b=XyCsFemgK8hOwQcfb8K3JWFe3ZQA2R9iRuQ7m1Vz8L+7BT8PG+3UoAqq+JojKnwvUchgQ/i7+JSzdvKqMbe25DIb9ot/z6diXzBL8g6kxaBns8oXzzSQBWGzyEppnnXh9OOQE7/f3xCIHHTUKgkBcsW2O9Fw0Fsi34SUGkJ/whw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741451615; c=relaxed/simple; bh=tM7Z1MIuoa/H4YwFnFknjGiGKPNlBmSaJxIzbb0eGDk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IMRiVSE9afdyidq5wY9Axfy17Y+X0iXOtihOhpiAg1AEAgS83dtqG26sLEYALSO0XO+w/PAP1EJr7o8lQTLEX5o3J6OWBK05exkGnxq+32NWVoOFA+D3YOT5K4y0k2TeH+X86enFbcN7Y0SdmKVJQ6ZYC95ODR59HIIa07pOpgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MIu04DLx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MIu04DLx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1470CC4CEE7; Sat, 8 Mar 2025 16:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741451614; bh=tM7Z1MIuoa/H4YwFnFknjGiGKPNlBmSaJxIzbb0eGDk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MIu04DLxZwEmwBIzWaHbgfhISn6yiqjivHJe03p3ZKnFn36PELOhRqaddAcbavYqc 8M5Z1otxTkuT4q9P8zRv2VFQwnZ8QG8LBBV+QKzgriwyaXHEe6lJ0BfzOjG4fYckid Z8nhQgdPfL3bc3vHutkwuE0uOtojmi1mWMNlViuCmVDsP8+M5vjbfCHZ3AnIVeZi63 22SPJbPNZWX81dhjMpifa5ryLTvFs6vz37u3DAKvgw96kl6GGCqYiHGW+6Sk2LLMF0 1lJNgha7B6z6S55T5eqNfUPPmyzPojD5NeRnesvnI2Iamha3jFVmliqjFjYBnEdsA7 pozWP3Mn3VT4w== Date: Sat, 8 Mar 2025 16:33:22 +0000 From: Jonathan Cameron To: Matti Vaittinen Cc: Matti Vaittinen , Lars-Peter Clausen , Lad Prabhakar , Chen-Yu Tsai , David Lechner , Javier Carrasco , Guillaume Stols , Olivier Moysan , Dumitru Ceclan , Trevor Gamblin , Matteo Martelli , Alisa-Dariana Roman , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH v5 04/10] iio: adc: rzg2l_adc: Use adc-helpers Message-ID: <20250308163322.63d6e053@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.3.0 (GTK 3.24.48; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 3 Mar 2025 13:32:29 +0200 Matti Vaittinen wrote: > The new devm_iio_adc_device_alloc_chaninfo() -helper is intended to help > drivers avoid open-coding the for_each_node -loop for getting the > channel IDs. The helper provides standard way to detect the ADC channel > nodes (by the node name), and a standard way to convert the "reg" > -propereties to channel identification numbers, used in the struct spell check: properties > iio_chan_spec. Furthermore, the helper can optionally check the found > channel IDs are smaller than given maximum. This is useful for callers > which later use the IDs for example for indexing a channel data array. > > The original driver treated all found child nodes as channel nodes. The > new helper requires channel nodes to be named channel[@N]. This should > help avoid problems with devices which may contain also other but ADC > child nodes. Quick grep from arch/* with the rzg2l_adc's compatible > string didn't reveal any in-tree .dts with channel nodes named > otherwise. Also, same grep shows all the .dts seem to have channel IDs > between 0..num of channels. > > Use the new helper. > > Signed-off-by: Matti Vaittinen Code looks good to me. J