[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140814210253.GF17528@sirena.org.uk>
Date: Thu, 14 Aug 2014 22:02:53 +0100
From: Mark Brown <broonie@...nel.org>
To: Addy Ke <addy.ke@...k-chips.com>
Cc: heiko@...ech.de, dianders@...omium.org, grant.likely@...aro.org,
robh+dt@...nel.org, 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
Subject: Re: [PATCH] spi: rockchip: return 0 if tx_buf and rx_buf are NULL
On Thu, Aug 14, 2014 at 08:52:24AM +0800, Addy Ke wrote:
> 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.
> 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;
> }
We should be implementing this in the core rather than the driver - just
not even call into the controller driver if there's nothing to do. That
way we make sure that every driver works properly. After all, the delay
itself is implemented in the core.
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists