From patchwork Wed Aug 21 10:59:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 13771232 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 BEB09C52D7C for ; Wed, 21 Aug 2024 11:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=82Txq8wjdCnYwZ4j95zlkdbSO+k6QphWbvjQj7xx3Mw=; b=PHOmFVttEymmOGXQtLy3lEmL8B 58lLCMKVRXA6l9u/eE8uJIJdjxCAFoacbVQikc9ebmAjCyvSvxXxEd/xhi92NOMiaEW0i3o8Ssag3 srYxnUaeWFoKV+SQbIX2qTn4LMYv4rI1Kfi6L/M2/wbxLw14FnVX4ypr7PwjkDkSCtzL1U6DvclX5 l9UkUcxw+efUw2YEaFMtU45wmewnNtMA2IOahKJQv+6EfYLJD3sSZ8pjVvrDe1ybZcKGlFeSLXhHW 67oVdblSP363YRii4frlYAZhiGYsuuRFNJ7DEHnN9/8mW5XiR8P4EZJchK/txD3GVQ+V+/2FxYyHL 6ER9MN0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgj5s-00000008Y6B-3Rad; Wed, 21 Aug 2024 11:01:36 +0000 Received: from mail.thorsis.com ([217.92.40.78]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgj4E-00000008XRi-0AGY for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 10:59:56 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D30F31483DF2; Wed, 21 Aug 2024 12:59:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1724237991; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=82Txq8wjdCnYwZ4j95zlkdbSO+k6QphWbvjQj7xx3Mw=; b=qTbTlp5JakJrsN0woUsh5s94nZgneFmNAoyviJMtzyfQ0lInYveVm/gdfwHGfPgESSmPYW Mk6ZhapHCM68T+FfA9eNyNmySbp1/6JUp4A9ugeAq5W/PTdWnQFoc1BvylP3E+nh8EwmOC ZzW/hf5duBG8wm2soyTi+ab8E24paU3MREzfXecY+H7wXklmCkdFlaPgz38FI4qLNsOzub Dmln7iBA3+5/qu7W4X6EM6ge9O4E6p403K6PpmyNX4kpk1FdHQH2r7wWkqC/+FaLUcqg7+ mIjeKBJcujk2+BGLeuZdrBGxlvV5c9joAOCYkiJbXcf+Qk98aPqTe5FbGGxR8A== From: Alexander Dahl To: Claudiu Beznea Cc: Christian Melki , Srinivas Kandagatla , linux-arm-kernel@lists.infradead.org (moderated list:MICROCHIP OTPC DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 02/12] nvmem: microchip-otpc: Fix swapped 'sleep' and 'timeout' parameters Date: Wed, 21 Aug 2024 12:59:33 +0200 Message-Id: <20240821105943.230281-3-ada@thorsis.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240821105943.230281-1-ada@thorsis.com> References: <20240821105943.230281-1-ada@thorsis.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_035954_316214_E65FA734 X-CRM114-Status: GOOD ( 11.32 ) 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 Makes no sense to have a timeout shorter than the sleep time, it would run into timeout right after the first sleep already. While at it, use a more specific macro instead of the generic one, which does exactly the same, but needs less parameters. Signed-off-by: Alexander Dahl --- drivers/nvmem/microchip-otpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c index 03e60b99f2c9..bd3383eabdf6 100644 --- a/drivers/nvmem/microchip-otpc.c +++ b/drivers/nvmem/microchip-otpc.c @@ -87,8 +87,8 @@ static int mchp_otpc_prepare_read(struct mchp_otpc *otpc, writel_relaxed(tmp, otpc->base + MCHP_OTPC_CR); /* Wait for packet to be transferred into temporary buffers. */ - return read_poll_timeout(readl_relaxed, tmp, !(tmp & MCHP_OTPC_SR_READ), - 10000, 2000, false, otpc->base + MCHP_OTPC_SR); + return readl_relaxed_poll_timeout(otpc->base + MCHP_OTPC_SR, tmp, + !(tmp & MCHP_OTPC_SR_READ), 2000, 10000); } /*