diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2015-05-05 18:36:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-08 15:27:29 +0200 |
commit | ad44088f08a33894ca9fd65511d05d58434b50f4 (patch) | |
tree | 05726e6b4d6776b49e676a40469efade6dcacd8a /drivers/staging | |
parent | d24c3f07a6bae3b368681d25aa4eef380aa2e8f0 (diff) |
staging: unisys: visorchannel_write(): Use memcpy_toio() directly
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchannel.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |