Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp277958imn; Wed, 3 Aug 2022 03:33:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVVz8vOj+2ThG6oY45+pU4Gr3Q3HdBFv+KxiyXA4xZmDraAFrgqbeNqDiLxhFeD8eA3riO X-Received: by 2002:a17:906:d54b:b0:72e:ece1:2956 with SMTP id cr11-20020a170906d54b00b0072eece12956mr19540128ejc.156.1659522794884; Wed, 03 Aug 2022 03:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659522794; cv=none; d=google.com; s=arc-20160816; b=o+zm3COdbewreBa/QeoYmoz+0KTOqhWhRzraAPTnk2Q/2t4Sfn/2U5HjFuhot/pp0J xRI8borjzrNN9XjcBQ7ZapX0Y+4jrhpbOL1WkwZY0Wu8sz4Nw8iDK/0ntCnlZJp+xcn/ lJz/hYSr6lf+3F/n3iPRYnjILaOdyQyHO3f96Racs4N0gCIbeL7eMCULLDBCz1gQnHOc K5V49OU1qMzF+fM4aIvzgmbC1Czq9UXH/MZcSmbtkhCCoxnG2uqC9P8kOZcHfdPrOE/+ JqVCDVypnQbQB0VxtYewVsNZqtC/9KpRGLTwh+PCV1kTg5nlYwQntjD+FWvh1T1vft6J PNPA== 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:date:subject:cc:to:from :dkim-signature; bh=zphhn6onmYlZUrteq4X1F80OESpQQYLO27yJwoG6t9Q=; b=h8ens95i2bqXnfkAJkhF235f203pQ4boem+biklLNYCddqU94TY2x15VN8b8EIMeLf 2wmYA75qnC8p7Y/GZX1YZnz4jgoUMtpmXzbTpTLjBizISEA3jQNKEWzQUDH5MY8va9NI qf7IG3wmHCZDWwjqWbqFcDRn7ASZ5t/MGdy0+j93M8WcK3Ym+miNlnZ4CjfiiZTVg5LW xvNSM1EutaVwICujG3uwYBZTgTkuyu07aF2ttelH+Ek5hag2MfZNP/Tr2K3DdQg1mLBX TkS9Rvzsp9vv/J8mL9AUFnu103a94zOdmNUgaupmPBSaw4qJotK32xXvFOVVsodpfMM6 cGgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qfaZ+beQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170906794600b00729c19c5106si16887091ejo.999.2022.08.03.03.32.50; Wed, 03 Aug 2022 03:33:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qfaZ+beQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234360AbiHCK2h (ORCPT + 99 others); Wed, 3 Aug 2022 06:28:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237989AbiHCK1j (ORCPT ); Wed, 3 Aug 2022 06:27:39 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B106C564F6; Wed, 3 Aug 2022 03:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1659522437; x=1691058437; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Of7iBAw/FGTaGozPvaStbkwhhPZUmle5SrpDpON9PI4=; b=qfaZ+beQcMv4VW6nTfCV9Y1hReyt+oBhgwTpCZcd+6H9J+1q+sV7PqKH +jlrYbdw4l0Q6dT6ZYSawrVGHIHBKQVCGGX5hQWA5mbWuC/O7p8SKOkfG 1Z2Cgrm33vQhvNwH2tGQat2GaRCxsXSqYr++Qq/kJ5ETayrG+wOSJpGA1 gyQQ0DnCqJNWlVpuERDEtIW65JsQUtJJTJ3iP0Cu2bLnj+SnRWNGXC3S/ K1nr2DLdFZpyvML08ikdLRcIJwpuv5zmfrj/8UFAS/rz0FmeyJ8ALubED 12+r9EnMt4E0cFIVrjJyoiwmpK3Px1zbv0sXCviPL4HYGXTeXXaYFJQX2 w==; X-IronPort-AV: E=Sophos;i="5.93,214,1654585200"; d="scan'208";a="184901670" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Aug 2022 03:27:16 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 3 Aug 2022 03:27:16 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Wed, 3 Aug 2022 03:27:13 -0700 From: Claudiu Beznea To: , , , , , , CC: , , , , Claudiu Beznea Subject: [PATCH v3 12/19] iio: adc: at91-sama5d2_adc: move oversampling storage in its function Date: Wed, 3 Aug 2022 13:28:48 +0300 Message-ID: <20220803102855.2191070-13-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220803102855.2191070-1-claudiu.beznea@microchip.com> References: <20220803102855.2191070-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Move the storage of oversampling_ratio in at91_adc_config_emr(). This prepares for the next commits. Signed-off-by: Claudiu Beznea --- drivers/iio/adc/at91-sama5d2_adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index d6a93aa7fbaf..a1df475a6f29 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -793,6 +793,8 @@ static int at91_adc_config_emr(struct at91_adc_state *st, at91_adc_writel(st, EMR, emr); + st->oversampling_ratio = oversampling_ratio; + return 0; } @@ -1705,8 +1707,6 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev, mutex_lock(&st->lock); /* update ratio */ ret = at91_adc_config_emr(st, val); - if (!ret) - st->oversampling_ratio = val; mutex_unlock(&st->lock); iio_device_release_direct_mode(indio_dev); return ret; -- 2.34.1