wlcore: Propagate errors from wl1271_read_hwaddr
authorIdo Yariv <ido@wizery.com>
Mon, 18 Jun 2012 15:15:50 +0000 (18:15 +0300)
committerLuciano Coelho <coelho@ti.com>
Fri, 22 Jun 2012 07:49:45 +0000 (10:49 +0300)
Propagate errors from wl1271_read_hwaddr. This function is only used
when reading the FW log (following a recovery), so don't read the FW log
in case of a bus error.

Also rename prefixes of wlcore functions which their prototypes had to
be changed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/io.h
drivers/net/wireless/ti/wlcore/main.c

index 5e4a3d174004852bc15ef7396f3b7ad0becd3fe6..4a6688b03aea79a59aa99ede89c3be052b483a04 100644 (file)
@@ -131,7 +131,7 @@ static inline int wlcore_read_data(struct wl1271 *wl, int reg, void *buf,
        return wlcore_read(wl, wl->rtable[reg], buf, len, fixed);
 }
 
-static inline void wl1271_read_hwaddr(struct wl1271 *wl, int hwaddr,
+static inline int wlcore_read_hwaddr(struct wl1271 *wl, int hwaddr,
                                      void *buf, size_t len, bool fixed)
 {
        int physical;
@@ -142,7 +142,7 @@ static inline void wl1271_read_hwaddr(struct wl1271 *wl, int hwaddr,
 
        physical = wlcore_translate_addr(wl, addr);
 
-       wlcore_raw_read(wl, physical, buf, len, fixed);
+       return wlcore_raw_read(wl, physical, buf, len, fixed);
 }
 
 static inline int wlcore_read32(struct wl1271 *wl, int addr, u32 *val)
index 546fcb074c6ed42eb771a210d3a76e57d38dd264..b0795aac4bac90931561cdb95e0d9616d0fbed24 100644 (file)
@@ -851,8 +851,10 @@ static void wl12xx_read_fwlog_panic(struct wl1271 *wl)
        /* Traverse the memory blocks linked list */
        do {
                memset(block, 0, WL12XX_HW_BLOCK_SIZE);
-               wl1271_read_hwaddr(wl, addr, block, WL12XX_HW_BLOCK_SIZE,
-                                  false);
+               ret = wlcore_read_hwaddr(wl, addr, block, WL12XX_HW_BLOCK_SIZE,
+                                        false);
+               if (ret < 0)
+                       goto out;
 
                /*
                 * Memory blocks are linked to one another. The first 4 bytes