Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11155073imu; Thu, 6 Dec 2018 12:27:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/WmX9/ydYDpDKKN0n/P96VsqxNrD0AOTVplrRqk8JxNphwKktl9SuYWAGkvc6L+Zs9hIQEP X-Received: by 2002:a62:8949:: with SMTP id v70mr29212400pfd.85.1544128067608; Thu, 06 Dec 2018 12:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544128067; cv=none; d=google.com; s=arc-20160816; b=cpg8ZNwNxtdPXhDS69XzhNEyVwasVeladYiwrTz5FFEsem1+dhyt1Hj0Q6+qiGukAe iZSikGG7zn/7G13Gx6tm2epkAfh+7O5Dx7AJDEqhYnJqG4xBe0AXIxfK66ctMdwa2hNo IIYEvBomA413Gwh4Q64d6QeTMl0HtXmFy3rvABCMl3Gvc+7f7Ks9VSYHb32iAuXVIYPy Yk5yjh8/HLCJrT1M6L96AcTIr0jPS67OBgfpWilW72rcP8wV0x/d6SzvLwtDiFXQEHr8 IkzlM1M4i2/1LzlEF0APhUfNSFWcH5+722nXngDCEM10p1sHh2gfZqvn7Rlem0MyUr7G es8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=DLRlTiuMZBjUlVcIoi5M3mznlf7ZF6F+8wxYhmvyBVA=; b=e+qL55qziNRBX14ugKTPVNL9oHFSS/VyXm/kL8CRH2sKlkHdxX8WAG9Cei+N9SjpcA yvLmxcFsLGA+FTkzt134MGdr6yBBO6IxaaUPjNlmNfe6JPOFV+0T/KgQQZd4ixIU1ynm hGkWCnV5lA6xTYE0wokxCvPZUsSS6IZuHkYboMVNxHBcGauwuFxMUKPhM5mZIaROy4m4 CLoA5AbY3xIsFXEin+m4Ur8Y0MzDnX4ZdX4eG134Wv7AuU2VRBdWyzUhT3XpLmGtHNaf sSKqfkYfcdb/cGZA6vbaqSEOwfkCqcKAgb0Ap2krT7uRZOATnNpl6kAzz30TFpKkFrNl EQDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=iwN8kmXP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n33si963729pgl.336.2018.12.06.12.27.32; Thu, 06 Dec 2018 12:27:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=iwN8kmXP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726159AbeLFU0e (ORCPT + 99 others); Thu, 6 Dec 2018 15:26:34 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:37538 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbeLFU03 (ORCPT ); Thu, 6 Dec 2018 15:26:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=DLRlTiuMZBjUlVcIoi5M3mznlf7ZF6F+8wxYhmvyBVA=; b=iwN8kmXP9W+a 1ESY3eWzU9A3GEZakxutiq1xESVCw0vI1l+jHFpzxEIeieJsRBNlrrVqeMAkP7dZmW/ithpe59Cpj XEga1+BgpMlcFoi2Z8WjS7hve1XsqXp+9z0/9OO0p88PTSWOQFqF4TiI/qvNuDci/i89jjoo/bGt8 AP1Jc=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gV0E3-0001iK-J7; Thu, 06 Dec 2018 20:26:23 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 45BB811252F7; Thu, 6 Dec 2018 20:26:23 +0000 (GMT) From: Mark Brown To: Tomer Maimon Cc: Mark Brown , broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, yuenn@google.com, venture@google.com, brendanhiggins@google.com, avifishman70@gmail.com, joel@jms.id.au, linux-spi@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-spi@vger.kernel.org Subject: Applied "spi: npcm: Modify pspi send function" to the spi tree In-Reply-To: <20181204134035.124079-1-tmaimon77@gmail.com> X-Patchwork-Hint: ignore Message-Id: <20181206202623.45BB811252F7@debutante.sirena.org.uk> Date: Thu, 6 Dec 2018 20:26:23 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: npcm: Modify pspi send function has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 1fa33be36cfc8908be951ed56113906f422add50 Mon Sep 17 00:00:00 2001 From: Tomer Maimon Date: Tue, 4 Dec 2018 15:40:35 +0200 Subject: [PATCH] spi: npcm: Modify pspi send function Align pspi send function code with the recieve function code, Also simplify the code a bit with early return. Signed-off-by: Tomer Maimon Signed-off-by: Mark Brown --- drivers/spi/spi-npcm-pspi.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c index dda91c19af93..e1dca79b9090 100644 --- a/drivers/spi/spi-npcm-pspi.c +++ b/drivers/spi/spi-npcm-pspi.c @@ -199,14 +199,22 @@ static void npcm_pspi_send(struct npcm_pspi *priv) wsize = min(bytes_per_word(priv->bits_per_word), priv->tx_bytes); priv->tx_bytes -= wsize; - if (priv->tx_buf) { - if (wsize == 1) - iowrite8(*priv->tx_buf, NPCM_PSPI_DATA + priv->base); - if (wsize == 2) - iowrite16(*priv->tx_buf, NPCM_PSPI_DATA + priv->base); + if (!priv->tx_buf) + return; - priv->tx_buf += wsize; + switch (wsize) { + case 1: + iowrite8(*priv->tx_buf, NPCM_PSPI_DATA + priv->base); + break; + case 2: + iowrite16(*priv->tx_buf, NPCM_PSPI_DATA + priv->base); + break; + default: + WARN_ON_ONCE(1); + return; } + + priv->tx_buf += wsize; } static void npcm_pspi_recv(struct npcm_pspi *priv) -- 2.19.0.rc2