From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86149C282C6 for ; Sun, 2 Mar 2025 03:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RqTaH49lbOylR7t9Chlho0r1oCb5eVX5QIgYxMrF3N0=; b=IH2+BFiYTKxgSv62qYUiNeGAcq yUW+HAehdyDXqW50ZeAposTjR8CTJB/ckCPas5aNgcGAgfXbOI7x/wYUo8E7jXqXEcmhl0nt5FpPB b52DvmA/9i61n3WmM6fB9QBz1EDigBhkFmleMfqcheA4lFRjNxG32qyWk2vuBfX3wKx1ZHYf0YLfr fgxG4HESXtqWIGkLZXWeXd5zst/rOVOvY73er1F1ehgcj5mYmFsXektF5IJyq0p2ZPhvlh1fuCJC/ Lvmx20L96vJFswRNW+kIo89/LF4jlIZmaNSIsEVMi7RCF93YiqWJOafqct2x6Upsozt/kP3y3kM7F 0vnD/UOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1toaFa-0000000FKL8-08cD; Sun, 02 Mar 2025 03:44:22 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1toaE2-0000000FKAR-3Erc for linux-arm-kernel@lists.infradead.org; Sun, 02 Mar 2025 03:42:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 36FE55C06E5; Sun, 2 Mar 2025 03:40:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C38FC4CEE2; Sun, 2 Mar 2025 03:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740886965; bh=IYvdJFccA3LUSxGP+VKKzb51QaP82ywJ2G8axSjP68A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ek7mtFbupwId0+cjvOY0Vei9e3TnyfaHVXNgylbQ9k4zhTqThOLZmwKS8W7pYeB+J ZIzxnWNfMp3oMHH8+HqJAh2e0+hjJ9TFVObtT8KgaScVyBUPnnBSPKrmg+6/c29+Yv yn2AHe4sBGc2LUBKjluGL6LCc2RZV7u+CKpumpu/cyTyhQ0GelHbXE0Z9b2lARCGRQ PZciJUwCo+8VIgoc/SMYzDb3DkY5Euy+fgZmcBJb7f3TUxetabF3daaCENrHFJ+Nqo RVRG9fN1ud5nIcyYX+MYbTzWK+U1+YedeacVjxX0R7i3WlfY+n4ukoLlEBAd1cG0bH cNHNA3hnXS1IQ== Date: Sun, 2 Mar 2025 03:42:21 +0000 From: Jonathan Cameron To: Matti Vaittinen Cc: Matti Vaittinen , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Lad Prabhakar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Hugo Villeneuve , Nuno Sa , David Lechner , Javier Carrasco , Guillaume Stols , Olivier Moysan , Dumitru Ceclan , Trevor Gamblin , Matteo Martelli , Alisa-Dariana Roman , Ramona Alexandra Nechita , AngeloGioacchino Del Regno , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v4 05/10] iio: adc: sun20i-gpadc: Use adc-helpers Message-ID: <20250302034221.3c70c95f@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.3.0 (GTK 3.24.48; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250301_194246_921134_52DCEDD8 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 24 Feb 2025 20:33:46 +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", > "diff-channels", "single-channel" and the "common-mode-channel" to > channel identification numbers used in the struct iio_chan_spec. > Furthermore, the helper checks the ID is in range of 0 ... num-channels. Needs update. > > 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 sun20i-gpadc's compatible > string didn't reveal any in-tree .dts with channel nodes named > othervice. Also, same grep shows all the in-tree .dts seem to have > channel IDs between 0..num of channels. > > Use the new helper. > > Signed-off-by: Matti Vaittinen > Otherwise looks good to me. Jonathan