Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp436674rdb; Tue, 5 Dec 2023 09:19:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtf8dpPgpjio1c5R/TrNEPwLPvPwk/Jx1iQjKw+Ti5czn+AmXc2biWob1ng7wHSCfmql9C X-Received: by 2002:a17:902:d355:b0:1d0:b92d:b165 with SMTP id l21-20020a170902d35500b001d0b92db165mr2265773plk.7.1701796774121; Tue, 05 Dec 2023 09:19:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701796774; cv=none; d=google.com; s=arc-20160816; b=R5VidXkjAp94zMKGDmZ/cF9iYvS78kjMJ0DiVKntJeJ6AUPfhg6jawd+yl6lMjBoOY 7vRD2yLJnXd7KoqyPGZHmwCEXTsjWudSEpKriDB2cYwAPDvFSIxicORGEpKgbiv3ffSg prLFzs4PPNPgkSvFwojuFISGkvx6EAk4KmusJzhtdjufkXrilgNzviLhxXO6sahSiqxP yCioSttH1aLDlkNjTPzkiGDjgfcz/Remxu3gPRNjvH97hEbplmqU4Pn66WKYQzW8+kFW zL4KFeAbqraSVEAjIRHTUsCvZAlCOrXoy08MbicpIEBSZqtbcMVWzzN3UEgt6TOtYoQ/ 06Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5od17CCw3d2dAkBoyKG6VGOgbqOUrc3jqgfEdgNJpwc=; fh=XWw+BW6ysVVvGwvBQ/Y14nJAJ2sn5fZpKa7olY0ritM=; b=GHdxvkmxf/Jmlr1GXIMBWrlgw5AcvT/LS8R9r3wHeN7xQCzb+Nz4v5jaiO+ycTvgvi qm7SQnVOlFQEe+2enbBw0is1l8pR58w2r1u2/ycUcutViPgXml5UtcDbXhId5Jek86o6 SGETBwTOye3OPVNWUCiXD1gcRClfdzalIA38YHR8XH4VH1oDQhR8a9Wa8COTNQxTjNkB oZajo+58quAB4cACC8NMf/cRV7hcDzb4hYqvbFKcEiGPO11iRTQFfaddEshXgy7giijH c4Wbk+7EgeUZMbMFYmvyR9kwJTFMtAyyr/dR+KIjOePJwI4yJ8smZICF8Sk7TqRlOPM6 /vvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e8-20020a170902744800b001cfe203187bsi6739668plt.296.2023.12.05.09.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 09:19:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B46B18030B85; Tue, 5 Dec 2023 09:18:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345994AbjLERSQ (ORCPT + 99 others); Tue, 5 Dec 2023 12:18:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235091AbjLERSP (ORCPT ); Tue, 5 Dec 2023 12:18:15 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194E9C0; Tue, 5 Dec 2023 09:18:22 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="425085150" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="425085150" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 09:18:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="841545261" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="841545261" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 09:18:16 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rAZ3k-000000026Ns-2qE0; Tue, 05 Dec 2023 19:18:12 +0200 Date: Tue, 5 Dec 2023 19:18:12 +0200 From: Andy Shevchenko To: Ceclan Dumitru Cc: linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, Lars-Peter Clausen , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Walle , Arnd Bergmann , ChiaEn Wu , Niklas Schnelle , Leonard =?iso-8859-1?Q?G=F6hrs?= , 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: References: <20231205134223.17335-1-mitrutzceclan@gmail.com> <20231205134223.17335-2-mitrutzceclan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 05 Dec 2023 09:18:26 -0800 (PST) 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. */ -- With Best Regards, Andy Shevchenko