From patchwork Thu Jun 9 08:32:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12875009 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 241CDC43334 for ; Thu, 9 Jun 2022 08:37:03 +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=bQ/ZFuiS+T5LKk3SJ7eVxmI3Wxbg6yz0MVz/I5ReDZc=; b=I5haxeKIgkMLxG A+6DR+4gzzwA09oe57oKBjQleazeDZa0x6pTj2btqkd3KCkNhfJJ+tAfbclpaxkEcseGZkI5qh/q3 SdBYfmPu9TH2EBUzVjtvRaCHHEO86lCMxkIekK1EFiPViDEZ1eSOP4Z5R8OcpclJio/J+ukT+calC bVrseHkuNN0H5ebqkrUKwXLKZX2vigWjT5uU+n/n4TA8zz198Z3pEvm5XcIlWxq6mTvR7K4D7epGp l04+dv2KOH3c7M9mQsbL7JnJPtdmC+cg03MAk8czJz6W0TYUItQqWo/xerK2Stji5BMYbbpNN1dAE AgVO6cyV/bL7JF+Glp/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzDdz-000Hx1-L4; Thu, 09 Jun 2022 08:35:56 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzDYg-000FR3-Kx for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 08:30:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1654763426; x=1686299426; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Nr/sHF4a/6eEUoNV9OryJpAze1cR1cqFM3Ai8nAzrTs=; b=Ggmu/LVOi2zqkeyMyEnBU6qB7uMTN1Kx29uzgbPmucXmMT4Cr87A5ZWx I7kbdX2bvXExR7ARJyLTgDUzquG15Lc2sBYfdkvlV8Qpc8e4G4EFbEpE4 Tril7YnfYooNc3FSBtxqqTOgTg9sXOdktVQ4YHfv49ZeHFpgD/0ShniU1 GqBhFdxxg7dl5Gf+pR9wD21fM7PVBT+vc4CpwibAwFGg+ATSpcGzrxL1B zlYBq9jaPv1FDZf6bp9VP5PXPLqzhJThB6fVIG4rJqZ5ft8jLxHU9r/z8 TtzpM3BzSjhpvo8+cNuDxHJBiUNMZClZmButYlLqRH6+Et8Wl0ccGv9/8 Q==; X-IronPort-AV: E=Sophos;i="5.91,287,1647327600"; d="scan'208";a="99259954" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Jun 2022 01:30:23 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 9 Jun 2022 01:30:21 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 9 Jun 2022 01:30:18 -0700 From: Claudiu Beznea To: , , , , , , , CC: , , , , Claudiu Beznea Subject: [PATCH 08/16] iio: adc: at91-sama5d2_adc: move oversampling storage in its function Date: Thu, 9 Jun 2022 11:32:05 +0300 Message-ID: <20220609083213.1795019-9-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220609083213.1795019-1-claudiu.beznea@microchip.com> References: <20220609083213.1795019-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-20220609_013026_798130_C8741ADC X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. 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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index fbb98e216e70..76367cc948e8 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -796,6 +796,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; } @@ -1695,9 +1697,6 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev, goto unlock; /* update ratio */ ret = at91_adc_config_emr(st, val); - if (ret) - goto unlock; - st->oversampling_ratio = val; unlock: mutex_unlock(&st->lock); return ret;