From: Jes Sorensen Date: Tue, 5 May 2015 22:36:54 +0000 (-0400) Subject: staging: unisys: visorchannel_write(): Use memcpy_toio() directly X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ad44088f08a33894ca9fd65511d05d58434b50f4;p=openwrt%2Fstaging%2Fblogic.git staging: unisys: visorchannel_write(): Use memcpy_toio() directly Signed-off-by: Jes Sorensen Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index bf2f17ac8e97..bf75aa075b74 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -216,10 +216,15 @@ visorchannel_write(struct visorchannel *channel, ulong offset, { size_t size = sizeof(struct channel_header); + if (offset + nbytes > channel->memregion.nbytes) + return -EIO; + if (!offset && nbytes >= size) memcpy(&channel->chan_hdr, local, size); - return visor_memregion_write(&channel->memregion, - offset, local, nbytes); + + memcpy_toio(channel->memregion.mapped + offset, local, nbytes); + + return 0; } EXPORT_SYMBOL_GPL(visorchannel_write);