Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
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);