Commit 81b6032f authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: unisys: memregion: Eliminate visor_memregion_resize()

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0dbb3fb6
......@@ -89,9 +89,22 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes,
if (uuid_le_cmp(guid, NULL_UUID_LE) == 0)
guid = channel->chan_hdr.chtype;
err = visor_memregion_resize(&channel->memregion, channel_bytes);
if (err)
iounmap(channel->memregion.mapped);
release_mem_region(channel->memregion.physaddr,
channel->memregion.nbytes);
channel->memregion.mapped = NULL;
if (!request_mem_region(channel->memregion.physaddr, channel_bytes,
MYDRVNAME))
goto cleanup;
channel->memregion.mapped = ioremap_cache(channel->memregion.physaddr,
channel_bytes);
if (!channel->memregion.mapped) {
release_mem_region(channel->memregion.physaddr, channel_bytes);
goto cleanup;
}
channel->memregion.nbytes = channel_bytes;
channel->size = channel_bytes;
channel->guid = guid;
......
......@@ -29,7 +29,6 @@ struct memregion {
void __iomem *mapped;
};
int visor_memregion_resize(struct memregion *memregion, ulong newsize);
int visor_memregion_read(struct memregion *memregion,
ulong offset, void *dest, ulong nbytes);
int visor_memregion_write(struct memregion *memregion,
......
......@@ -76,22 +76,6 @@ visor_memregion_get_pointer(struct memregion *memregion)
}
EXPORT_SYMBOL_GPL(visor_memregion_get_pointer);
int
visor_memregion_resize(struct memregion *memregion, ulong newsize)
{
int rc;
if (newsize == memregion->nbytes)
return 0;
unmapit(memregion);
memregion->nbytes = newsize;
rc = mapit(memregion);
return rc;
}
EXPORT_SYMBOL_GPL(visor_memregion_resize);
int
visor_memregion_read(struct memregion *memregion, ulong offset, void *dest,
ulong nbytes)
......
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