powerpc: Remove arch specific byteswappers from the MXC MMC driver
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 3 Feb 2015 05:36:23 +0000 (16:36 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 24 Mar 2015 02:33:50 +0000 (13:33 +1100)
When the MXC MMUC driver is used on a Freescale MPC512x machine, it
contains some additional byteswapping code (I'm assuming this is a
workaround for a hardware defect).  This uses the ppc specific st_le32()
function, but there's no reason not to use the generic swab32() function
instead.  gcc is capable of generating the efficient ppc byte-reversing
load/store instructions without the arch-specific helper.

This patch, therefore, switches to the generic byteswap routine.

Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
drivers/mmc/host/mxcmmc.c

index 5316d9b9e7b42f0bb1f5be0f8d16974ae93da041..317d709f75500fbc6aff6331ab48edb4d79f45b8 100644 (file)
@@ -281,7 +281,7 @@ static inline void buffer_swap32(u32 *buf, int len)
        int i;
 
        for (i = 0; i < ((len + 3) / 4); i++) {
-               st_le32(buf, *buf);
+               *buf = swab32(*buf);
                buf++;
        }
 }