cxgb4: Fixed incorrect check for memory operation in t4_memory_rw
authorHariprasad Shenai <hariprasad@chelsio.com>
Thu, 24 Jul 2014 11:46:30 +0000 (17:16 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Jul 2014 06:28:39 +0000 (23:28 -0700)
Fix incorrect check introduced in commit fc5ab020 ("cxgb4: Replaced the
backdoor mechanism to access the HW memory with PCIe Window method"). We where
checking for write operation and doing a read, changed it accordingly.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index e76885236e9d70adb6eabdc399b90cb67638af3d..448bec119c3ca147c611e52c34a884384358081e 100644 (file)
@@ -545,7 +545,7 @@ int t4_memory_rw(struct adapter *adap, int win, int mtype, u32 addr,
                unsigned char *bp;
                int i;
 
-               if (dir == T4_MEMORY_WRITE) {
+               if (dir == T4_MEMORY_READ) {
                        last.word = (__force __be32) t4_read_reg(adap,
                                                        mem_base + offset);
                        for (bp = (unsigned char *)buf, i = resid; i < 4; i++)