Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1147996rdb; Wed, 6 Dec 2023 09:48:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1qN/CZmA2i56613IM9Ir66/+8Vy7YAWChexT2uzFYZEWGkV4LVPOceA0JdDe+ruqwlf2i X-Received: by 2002:a05:6a21:1ca6:b0:187:a65c:d994 with SMTP id sf38-20020a056a211ca600b00187a65cd994mr972973pzb.30.1701884921050; Wed, 06 Dec 2023 09:48:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701884921; cv=none; d=google.com; s=arc-20160816; b=QD6ovi7FeQHFIuujx9AeMgLBN6tlavxen0LxM33J6WwTG04sk5nbceuV7/aEBxXxLa 7qnf94zd0VcGqEHtKQKhhvpwJDQ5MBVNILo5AvNftyTA1kWRtt1QgnYn/bRgLKqpjef6 O2lheOyrMQ+WBOF+Dj9bgDEbM4eOX24NqpTIhWn6KwRA8yr2ksvFPWirYCFPjlsZtAaL 2+Z6bawYRANcJ4bXPRq8Rcv6IM4HbYrrTeLIko8yUQ2/9qolPW/JRL/MNbj60adChlBS Oe1LEuklFuAW+HNcNCFBG6B1uJ/2mb50xR6c7PsjDIeWHVx4ZmraLai3TkA2Twpei/95 ahmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=4bJO3FvClvVe326xYwdB4N6IjUJbt6mJNg4XiQNJGJM=; fh=qnU8u6WCeCSQWpaN6QJo68DfsVOUkccg6J5lSkoSYNY=; b=zVCqo9K5t0XKUHBYnZmJzvLIvXVSaiU2fhHKxhNHhvK0XH3/wCP7hGFSJ70PgkdGe4 AFQrwUFH2hDy6P2FWGayG2vMG7GRYEXxsgI8IaOt+ogGHA8tdNLVX9jWjyx+I56ouIA4 c+OO3JHMg5mX+sMFiROE7+iI3KNF6O+W9whmZxrIo6u3aaqc1woD4jUcHktuP7dStRZc HZkslVB2ICbWZvuwEtastiuxHwrRwwtBFM2ZYcaotptvWDHqyzKKyN9xZdK/XrlAF4FA +5VG+OXOdFLPaUCv+X5ZWqYsEf7TqR++N/VNmDduLbZsYCffCkVBn8xh3rIOnqk6enyh jghg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DPSyVPjn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id g18-20020a056a000b9200b0069100706960si286003pfj.116.2023.12.06.09.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:48:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DPSyVPjn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5A78481BFCF6; Wed, 6 Dec 2023 09:48:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378918AbjLFRsZ (ORCPT + 99 others); Wed, 6 Dec 2023 12:48:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbjLFRsY (ORCPT ); Wed, 6 Dec 2023 12:48:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1619D122 for ; Wed, 6 Dec 2023 09:48:31 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C504C433C7; Wed, 6 Dec 2023 17:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701884910; bh=b+oE6WsHAnybfoP/OnxbwTMatDU+zF/XLbHsR/CzzPg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DPSyVPjn+clKvT2z6WZzk3hL6nRgad2xpb/ZK4qhPoA0rRfFFTmK/PwBscyB9/GGI Lk28pcZ5K9zcqfLY+Y6/qbS/y/gnm29uMvwdr+50JMtRK2IMZ/RWSml3ByNiYs4rOV VwU+0vVMKXtKfBYId7Mx/cHkagMcExZrQG2/bn22btiRSo+rgNs8D7IGdkpWFXS35H Nn5FXqfzHolu7igyMSyYCyqXCvQLuz9vLCJ5IdYL7aS/ljsJwwgDKD5r43MEE26Ztk q+9UeKFiy4cLyjlk48+B6lPcARiUN7joF1QuGIdEE2VehctlPiydE9bmwf2XrH6X2u W0SoSDdMpIKhg== Date: Wed, 6 Dec 2023 17:48:17 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: Ceclan Dumitru , linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Walle , Arnd Bergmann , ChiaEn Wu , Niklas Schnelle , Leonard =?UTF-8?B?R8O2aHJz?= , Mike Looijmans , Haibo Chen , Hugo Villeneuve , Ceclan Dumitru , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 2/2] iio: adc: ad7173: add AD7173 driver Message-ID: <20231206174817.2bc4f39f@jic23-huawei> In-Reply-To: References: <20231205134223.17335-1-mitrutzceclan@gmail.com> <20231205134223.17335-2-mitrutzceclan@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 06 Dec 2023 09:48:38 -0800 (PST) On Tue, 5 Dec 2023 19:18:12 +0200 Andy Shevchenko wrote: > On Tue, Dec 05, 2023 at 06:12:18PM +0200, Ceclan Dumitru wrote: > > On 12/5/23 17:28, Andy Shevchenko wrote: > > >> + ref_label = ad7173_ref_sel_str[AD7173_SETUP_REF_SEL_INT_REF]; > > >> + > > >> + fwnode_property_read_string(child, "adi,reference-select", > > >> + &ref_label); > > >> + ref_sel = match_string(ad7173_ref_sel_str, > > >> + ARRAY_SIZE(ad7173_ref_sel_str), ref_label); > > >> + if (ref_sel < 0) { > > > Can we use fwnode_property_match_property_string()? > > > > fwnode_property_match_string() searches a given string in a device-tree > > string array and returns the index. I do not think that this function > > fits here as the DT attribute is a single string. > > I'm not talking about that. I mentioned different API call. > > /** > * fwnode_property_match_property_string - find a property string value in an array and return index > * @fwnode: Firmware node to get the property of > * @propname: Name of the property holding the string value > * @array: String array to search in > * @n: Size of the @array > * > * Find a property string value in a given @array and if it is found return > * the index back. > * > * Return: index, starting from %0, if the string value was found in the @array (success), > * %-ENOENT when the string value was not found in the @array, > * %-EINVAL if given arguments are not valid, > * %-ENODATA if the property does not have a value, > * %-EPROTO or %-EILSEQ if the property is not a string, > * %-ENXIO if no suitable firmware interface is present. > */ > Which is in the togreg branch of iio.git (was a patch from Andy that I've queued up) Jonathan