From patchwork Tue Jun 28 15:16:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12898476 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 46ECBC43334 for ; Tue, 28 Jun 2022 15:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7T70I0EXTN47ANJfDbB1PifHUjru4HoEyjJr2e/xR+U=; b=E0PPYr4gaD40qP 14Hp5nCSqaJYxKVcL6PtG3GbZYh4d5LbSe3ay09EIDSn8IppYfmMpd+s+I7Dd+qrZr4kWJkR2QrYM +UEWQEJY3FZF3yurSfz7zohGbCXmNnKucrRY+80IvhoAtvmk6QOZZlcYZ1VdVXDncrSPVfr2+f6LS shvmsajhJCpKBhm/vJWAU4/QQwXIN+YHYIUDz/afyepa7IbdN4U5dPDeE48/t0iYf88OJ3EGNpDjT qBcwS8swKZhJe6rQZoahBmqPkTEFL2fcdX642C5JPu+ybAk3o53bi1tvEhrC/IpclarpoGIa72kTu zMktsiH+MZ9+DiAFcBxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6D2A-006sk3-Uy; Tue, 28 Jun 2022 15:21:47 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6CvY-006qCa-GY for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 15:14:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1656429297; x=1687965297; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/944kLo78fvBdyEUIQtXZH5Aejk5V1Uwl/hxYvOfRg0=; b=O/7KQMrK1PibKb+fZKYgrQDhIqfR0uBo3hbc8eU69IIL+FPKLTf7Dj/Q M/L85wMe+xRpfNeQwxg7XlnPyKELBcjwrckN6M/1ptivJdKYlm3rQ7pQN pKd4AJz9n7XcRLZA3SVary+99TgJv/PGBZkGIz3fVvMAd2UEpw1XFv+OR Q9j526bSDUahn98UrnpzFVsuB07YrT3hnlA6A7cI5pnjdbxuh1v2nYMOQ 3ew1sJW6YHPbmeGei3mOMu03XMpf0SnQ7ElABnoTA+mqBj1/aYgq+Vo6U ij+YKIaksmoLAhnWfZ4L+MUSxnxLMxNuv+U5n5aqUFTUFHPTo5aFgNat4 g==; X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="169940940" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Jun 2022 08:14:56 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 28 Jun 2022 08:14:54 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Tue, 28 Jun 2022 08:14:51 -0700 From: Claudiu Beznea To: , , , , , , , CC: , , , Subject: [PATCH v2 12/19] iio: adc: at91-sama5d2_adc: move oversampling storage in its function Date: Tue, 28 Jun 2022 18:16:24 +0300 Message-ID: <20220628151631.3116454-13-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220628151631.3116454-1-claudiu.beznea@microchip.com> References: <20220628151631.3116454-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_081456_592996_A1E6B00B X-CRM114-Status: GOOD ( 10.94 ) 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 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 254c084f7198..57c78cd23634 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; } @@ -1702,8 +1704,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;