diff mbox

[U-Boot,V2] drivers/block/systemace - added missing "else" in "ace_writew"

Message ID 1357205723-5022-1-git-send-email-alexey.brodkin@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Alexey Brodkin Jan. 3, 2013, 9:35 a.m. UTC
System ACE compact flash controller supports either 8-bit (default) or
16-bit data transfers. And in corresponding driver we need to implement
read/write of 16-bit data words properly for both modes of operation.

In existing code if width==8 both branches get executed which may cause
unexpected behavior of SystemAce controller.

Addition of "else" fixes described issue and execution is done as
expected for both (8-bit and 16-bit) data bus widths.


Signed-off-by: Alexey Brodkin <alexey.brodkin@gmail.com>
---
 drivers/block/systemace.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michal Simek Jan. 9, 2013, 4:50 p.m. UTC | #1
2013/1/3 Alexey Brodkin <alexey.brodkin@gmail.com>:
> System ACE compact flash controller supports either 8-bit (default) or
> 16-bit data transfers. And in corresponding driver we need to implement
> read/write of 16-bit data words properly for both modes of operation.
>
> In existing code if width==8 both branches get executed which may cause
> unexpected behavior of SystemAce controller.
>
> Addition of "else" fixes described issue and execution is done as
> expected for both (8-bit and 16-bit) data bus widths.
>
>
> Signed-off-by: Alexey Brodkin <alexey.brodkin@gmail.com>

Acked-by: Michal Simek <monstr@monstr.eu>

Tom: Can you please add this patch to your tree?
This is bug fixes which should go to 2013.01.

If you want to me to add this single patch to my tree and ask for request
please let me know. Just easier to apply it directly.

Thanks,
Michal
diff mbox

Patch

diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c
index 247cf06..27cacdf 100644
--- a/drivers/block/systemace.c
+++ b/drivers/block/systemace.c
@@ -66,7 +66,8 @@  static void ace_writew(u16 val, unsigned off)
 		writeb(val >> 8, base + off + 1);
 #endif
 	}
-	out16(base + off, val);
+	else
+		out16(base + off, val);
 }
 
 static u16 ace_readw(unsigned off)