lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Aug 2014 08:52:24 +0800
From:	Addy Ke <addy.ke@...k-chips.com>
To:	broonie@...nel.org, heiko@...ech.de, dianders@...omium.org,
	grant.likely@...aro.org, robh+dt@...nel.org
Cc:	linux-kernel@...r.kernel.org, linux-spi@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
	olof@...om.net, hj@...k-chips.com, kever.yang@...k-chips.com,
	xjq@...k-chips.com, huangtao@...k-chips.com, zyw@...k-chips.com,
	yzq@...k-chips.com, zhenfu.fang@...k-chips.com, cf@...k-chips.com,
	zhangqing@...k-chips.com, hl@...k-chips.com,
	wei.luo@...k-chips.com, Addy Ke <addy.ke@...k-chips.com>
Subject: [PATCH] spi: rockchip: return 0 if tx_buf and rx_buf are NULL

To do so, spi communication can use an empty buf to pull up CS.

This patch merged from ChromiumOS tree.
Cros_ec use this function to turn off CS and add a delay to ensure
the rising edge doesn't come too soon after the end of the data.

Tested-by: Doug Anderson <dianders@...omium.org>
Signed-off-by: Doug Anderson <dianders@...omium.org>
Signed-off-by: Addy Ke <addy.ke@...k-chips.com>
---
 drivers/spi/spi-rockchip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 72fb287..1e3bcfa 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -511,8 +511,8 @@ static int rockchip_spi_transfer_one(struct spi_master *master,
 	WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
 
 	if (!xfer->tx_buf && !xfer->rx_buf) {
-		dev_err(rs->dev, "No buffer for transfer\n");
-		return -EINVAL;
+		dev_dbg(rs->dev, "No buffer for transfer\n");
+		return 0;
 	}
 
 	rs->speed = xfer->speed_hz;
-- 
1.8.3.2


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ