Thread (2 messages) flat view 2 messages, 2 authors, 2009-09-14

Re: [PATCH] Xilinx: SPI: Fix bits_per_word for transfers

From: Grant Likely <hidden>
Date: 2009-09-14 18:37:51

On Mon, Sep 14, 2009 at 12:17 PM, John Linn [off-list ref] wrote:
The bits_per_word value can be set for each transfer, or can
be set to zero in each transfer in which case it should default
to the value in the driver.

The driver was fixed to properly check the bits_per_word in
the transfer that is passed in.

Signed-off-by: John Linn <redacted>
Looks good to me.

Acked-by: Grant Likely <redacted>
quoted hunk ↗ jump to hunk
---
=A0drivers/spi/xilinx_spi.c | =A0 =A03 ++-
=A01 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 46b8c5c..5a143b9 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -148,7 +148,8 @@ static int xilinx_spi_setup_transfer(struct spi_devic=
e *spi,
=A0{
=A0 =A0 =A0 =A0u8 bits_per_word;

- =A0 =A0 =A0 bits_per_word =3D (t) ? t->bits_per_word : spi->bits_per_wo=
rd;
+ =A0 =A0 =A0 bits_per_word =3D (t && t->bits_per_word)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0? t->bits_per_word : spi=
->bits_per_word;
=A0 =A0 =A0 =A0if (bits_per_word !=3D 8) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dev_err(&spi->dev, "%s, unsupported bits_p=
er_word=3D%d\n",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__func__, bits_per_word);
--
1.6.2.1



This email and any attachments are intended for the sole use of the named=
 recipient(s) and contain(s) confidential information that may be proprieta=
ry, privileged or copyrighted under applicable law. If you are not the inte=
nded recipient, do not read, copy, or forward this email message or any att=
achments. Delete this email message and any attachments immediately.


--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help