Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2001823rdf; Mon, 6 Nov 2023 01:26:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtm7cGAygSaeOvQO8h7t54J0xFYY/lPMXNm9TbzQ4BSmRupqcR8CD7c/CgkAwmT4HK05rs X-Received: by 2002:a05:6a20:5645:b0:17e:4f56:f5be with SMTP id is5-20020a056a20564500b0017e4f56f5bemr25368918pzc.22.1699262769816; Mon, 06 Nov 2023 01:26:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699262769; cv=none; d=google.com; s=arc-20160816; b=oQHpIuD0i7eDBqb62Ic0+nqFc0OuJwD+YMrq/cvsMpxEcXcySWR6ESqqat/47JNH+e HISlJ9PO81HLRe79b/RYSjIcE0ghgBUsPlWgHoNKvdo6Uwv4/8Jb9gpIUsCQ62b0aGia 62/ZZhFs9N/vBLSez2TY7H/+0KN1YXgvitpbzh60OF20zrg5y2eCMHBOKOo6JYrqP4Id iVOXB4k/1zoZbGneb7Ipl7B0exQuM8W70rhPuwjBfT9pndtgjSpmMhTtK6PNs881jrdL RMz27Pb1Abil8kwQ7xBCDjtRPne1//1kKOVj7g3AeOhE2ShAtp/8Jwh3X4X3tCgwR5K9 qzRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=y1MoY1fVCRAbq5Lml/6r1WQBnV1piHLAXm79P6FYzBM=; fh=+zwd53ykUCvf9MWWpK3gUrANbcEuKUCcmzpS/X3M0A8=; b=L9BtwCGEp1ai0kiXMXBiuZglCmP3/waO4hYD19haZ00ThqbAzlVjWXs5OA0x9qPNOb sBWDXiOqphFbOH4PTdqTt9PRuyao2z5DIRV2LXIwXk3z96VSD/fhLxMYhufFeG54L1SQ V8waKDc1fiOzXud7GWpJa7ULKTzqcDTMIExKcbkkJFGa8so5an32zM7Ejdq5K9FZ5WPm YlXxFaba0+wMtvLTRgI6pBCEc4rdxtdaFWhXqaqQCeWa0MiiwltJzRoE3GIbVbJOC1s1 PgSr0FVLBLpm306k4gbNC5DsyMV/EgicJZ6v9qoUuKGf+iogDXhozYLXWuYzV07lsB6Y jrPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IaDOXoQv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id oo1-20020a17090b1c8100b002800112448dsi8221009pjb.176.2023.11.06.01.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 01:26:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IaDOXoQv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D4452805D39D; Mon, 6 Nov 2023 01:25:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231266AbjKFJZL (ORCPT + 99 others); Mon, 6 Nov 2023 04:25:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbjKFJZI (ORCPT ); Mon, 6 Nov 2023 04:25:08 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B57BAB for ; Mon, 6 Nov 2023 01:25:03 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53df747cfe5so7162307a12.2 for ; Mon, 06 Nov 2023 01:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699262701; x=1699867501; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=y1MoY1fVCRAbq5Lml/6r1WQBnV1piHLAXm79P6FYzBM=; b=IaDOXoQvl6gQWM70nWyZlh6x7PfQQlYOlPboK2AelfqZQD78xTmBzgOqKz54CiXYi1 rD0DWEAOETK/yVHe2C3ydqligBiTsjt1p+6i1JU74lv2C9daSASfvfbyy+AqqJvSOih6 sXAvppGFu0KPh8pG8dxY1IdIzfYXPzhtQaLaTp4RsTj7bSrxurdvTP7TAcT0OUGGvwqe H59/jPPgPE8D4tXbEMc0Lpl3shcvAe1xMvSeq5d8g7ha0wjCeSP7kk6t0JGldRegsGPB 6TOnvDq+7LTtI1GPO8UMHkKZspkaqGNLvlbzpWWX5Knyr0Iyai4fhC9xF1jWBFOkCFiF QcBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699262701; x=1699867501; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y1MoY1fVCRAbq5Lml/6r1WQBnV1piHLAXm79P6FYzBM=; b=AJzsszohleJR9wonVDay52MGveZiMJ2MZu+7++DSZtJCHN1Lujda8IuUchAtD+P1ue BrrEyzaT5kFGbvrmQ5jtfpQIVKw4cIB7F0ijuetgDXvm2cGN2/yH6r5ApstTXoP3JrmF 2PNKUz7fd8fY7EOOan+LppayIGvridcx1DqGz4SULxPd8xY9AWLtC3VwyIkv38Niy7oj nEdoH9b2+zSY2kH1Lx5m9aKU9uV1Zl+b9p4Qs9oUAapBFonjU4jg0mCVzptOI+9pgXUm MKtXOAGC4sbhVgBxScKmxbO6yqQTpvc/HgY70wOJXqNTSNIYelB21pVxUQ8BOuEbJWG4 +cCA== X-Gm-Message-State: AOJu0YwTt0cbnf6FVS0ADFsgKsLB5TVPdOgOeA2XKRE2U9a+eV3+yLC+ hO6FtUKu7et5jbZiTAns1v2vTA== X-Received: by 2002:a05:6402:520d:b0:53b:3225:93c2 with SMTP id s13-20020a056402520d00b0053b322593c2mr29658511edd.8.1699262701479; Mon, 06 Nov 2023 01:25:01 -0800 (PST) Received: from [192.168.1.20] ([178.197.218.126]) by smtp.gmail.com with ESMTPSA id v28-20020a50a45c000000b0053f10da1105sm4234700edb.87.2023.11.06.01.24.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Nov 2023 01:25:01 -0800 (PST) Message-ID: <8fae735c-c227-4f60-8ba8-8cb13dfb2626@linaro.org> Date: Mon, 6 Nov 2023 10:24:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] iio: adc: ad7192: Use device api Content-Language: en-US To: alisadariana@gmail.com Cc: Alisa-Dariana Roman , Alexandru Tachici , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko , Maksim Kiselev , Cosmin Tanislav , Arnd Bergmann , Liam Beguin , Marius Cristea , Ibrahim Tilki , ChiaEn Wu , Ivan Mikhaylov , Marcus Folkesson , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231105193132.47009-1-alisadariana@gmail.com> <20231105193132.47009-2-alisadariana@gmail.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg S296bG93c2tpIDxrcnp5c3p0b2Yua296bG93c2tpQGxpbmFyby5vcmc+wsGUBBMBCgA+FiEE m9B+DgxR+NWWd7dUG5NDfTtBYpsFAmI+BxMCGwMFCRRfreEFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AACgkQG5NDfTtBYptgbhAAjAGunRoOTduBeC7V6GGOQMYIT5n3OuDSzG1oZyM4kyvO XeodvvYv49/ng473E8ZFhXfrre+c1olbr1A8pnz9v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I4il4y1+Bv89979rVYn8aBohEgET41SpyQz7fMkcaZU+ok/ +HYjC/qfDxT7tjKXqBQEscVODaFicsUkjheOD4BfWEcVUqa+XdUEciwG/SgNyxBZepj41oVq FPSVE+Ni2tNrW/e16b8mgXNngHSnbsr6pAIXZH3qFW+4TKPMGZ2rZ6zITrMip+12jgw4mGjy 5y06JZvA02rZT2k9aa7i9dUUFggaanI09jNGbRA/ABEBAAHCwXwEGAEKACYCGwwWIQSb0H4O DFH41ZZ3t1Qbk0N9O0FimwUCYDzvagUJFF+UtgAKCRAbk0N9O0Fim9JzD/0auoGtUu4mgnna oEEpQEOjgT7l9TVuO3Qa/SeH+E0m55y5Fjpp6ZToc481za3xAcxK/BtIX5Wn1mQ6+szfrJQ6 59y2io437BeuWIRjQniSxHz1kgtFECiV30yHRgOoQlzUea7FgsnuWdstgfWi6LxstswEzxLZ Sj1EqpXYZE4uLjh6dW292sO+j4LEqPYr53hyV4I2LPmptPE9Rb9yCTAbSUlzgjiyyjuXhcwM qf3lzsm02y7Ooq+ERVKiJzlvLd9tSe4jRx6Z6LMXhB21fa5DGs/tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20231105193132.47009-2-alisadariana@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 01:25:40 -0800 (PST) On 05/11/2023 20:31, alisadariana@gmail.com wrote: > From: Alisa-Dariana Roman > > Replace of.h and corresponding functions with preferred device specific > functions. > > Also replace of_device_get_match_data function with > spi_get_device_match_data. > > Signed-off-by: Alisa-Dariana Roman > --- > drivers/iio/adc/ad7192.c | 32 +++++++++++++++----------------- > 1 file changed, 15 insertions(+), 17 deletions(-) > > diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c > index adc3cbe92d6e..48e0357564af 100644 > --- a/drivers/iio/adc/ad7192.c > +++ b/drivers/iio/adc/ad7192.c > @@ -17,7 +17,6 @@ > #include > #include > #include > -#include > > #include > #include > @@ -364,19 +363,19 @@ static inline bool ad7192_valid_external_frequency(u32 freq) > freq <= AD7192_EXT_FREQ_MHZ_MAX); > } > > -static int ad7192_of_clock_select(struct ad7192_state *st) > +static int ad7192_device_clock_select(struct ad7192_state *st) > { > - struct device_node *np = st->sd.spi->dev.of_node; > + struct device *dev = &st->sd.spi->dev; > unsigned int clock_sel; > > clock_sel = AD7192_CLK_INT; > > /* use internal clock */ > if (!st->mclk) { > - if (of_property_read_bool(np, "adi,int-clock-output-enable")) > + if (device_property_read_bool(dev, "adi,int-clock-output-enable")) > clock_sel = AD7192_CLK_INT_CO; > } else { > - if (of_property_read_bool(np, "adi,clock-xtal")) > + if (device_property_read_bool(dev, "adi,clock-xtal")) > clock_sel = AD7192_CLK_EXT_MCLK1_2; > else > clock_sel = AD7192_CLK_EXT_MCLK2; > @@ -385,9 +384,10 @@ static int ad7192_of_clock_select(struct ad7192_state *st) > return clock_sel; > } > > -static int ad7192_setup(struct iio_dev *indio_dev, struct device_node *np) > +static int ad7192_setup(struct iio_dev *indio_dev) > { > struct ad7192_state *st = iio_priv(indio_dev); > + struct device *dev = &st->sd.spi->dev; > bool rej60_en, refin2_en; > bool buf_en, bipolar, burnout_curr_en; > unsigned long long scale_uv; > @@ -416,26 +416,26 @@ static int ad7192_setup(struct iio_dev *indio_dev, struct device_node *np) > > st->conf = FIELD_PREP(AD7192_CONF_GAIN_MASK, 0); > > - rej60_en = of_property_read_bool(np, "adi,rejection-60-Hz-enable"); > + rej60_en = device_property_read_bool(dev, "adi,rejection-60-Hz-enable"); Not strictly related to your patch, but where are these properties documented? Best regards, Krzysztof