From: Malcolm Priestley Date: Sun, 28 Feb 2016 19:02:57 +0000 (+0000) Subject: staging: vt6655: MACvSaveContext use memcpy_fromio to read context. X-Git-Tag: v4.6-rc1~103^2~261 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7e5120e949dac3ce436714ad686dff60ee75fc68;p=karo-tx-linux.git staging: vt6655: MACvSaveContext use memcpy_fromio to read context. Use memcpy_fromio to store data removing the need for local count. Signed-off-by: Malcolm Priestley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index c93592213310..66ae99137408 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -210,18 +210,15 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode) void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf) { void __iomem *io_base = priv->PortOffset; - int ii; /* read page0 register */ - for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE0; ii++) - VNSvInPortB((io_base + ii), (pbyCxtBuf + ii)); + memcpy_fromio(pbyCxtBuf, io_base, MAC_MAX_CONTEXT_SIZE_PAGE0); MACvSelectPage1(io_base); /* read page1 register */ - for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++) - VNSvInPortB((io_base + ii), - (pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii)); + memcpy_fromio(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0, io_base, + MAC_MAX_CONTEXT_SIZE_PAGE1); MACvSelectPage0(io_base); }