Commit 7e5120e9 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6655: MACvSaveContext use memcpy_fromio to read context.

Use memcpy_fromio to store data removing the need for local count.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e52ab0ec
...@@ -210,18 +210,15 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode) ...@@ -210,18 +210,15 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf) void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
{ {
void __iomem *io_base = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
int ii;
/* read page0 register */ /* read page0 register */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE0; ii++) memcpy_fromio(pbyCxtBuf, io_base, MAC_MAX_CONTEXT_SIZE_PAGE0);
VNSvInPortB((io_base + ii), (pbyCxtBuf + ii));
MACvSelectPage1(io_base); MACvSelectPage1(io_base);
/* read page1 register */ /* read page1 register */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++) memcpy_fromio(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0, io_base,
VNSvInPortB((io_base + ii), MAC_MAX_CONTEXT_SIZE_PAGE1);
(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
MACvSelectPage0(io_base); MACvSelectPage0(io_base);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment