summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorDavid Kershner2016-11-03 16:44:24 +0100
committerGreg Kroah-Hartman2016-11-07 10:56:39 +0100
commit5a80e98aafc7566659fe0fc542180871b29b706d (patch)
tree4f3c922f44a290c2c534b3a4c0d691c50171d371 /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: visorbus: remove bus_epilog (diff)
downloadkernel-qcow2-linux-5a80e98aafc7566659fe0fc542180871b29b706d.tar.gz
kernel-qcow2-linux-5a80e98aafc7566659fe0fc542180871b29b706d.tar.xz
kernel-qcow2-linux-5a80e98aafc7566659fe0fc542180871b29b706d.zip
staging: unisys: visorbus: my_device_create does not call device_epilog
Don't have my_device_create call device_epilog, have it call chipset_device_create directly instead. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorchipset.c')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 7a6b895e499f..d10712147601 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -939,6 +939,7 @@ static void
my_device_create(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
+ struct controlvm_message_header *pmsg_hdr = NULL;
u32 bus_no = cmd->create_device.bus_no;
u32 dev_no = cmd->create_device.dev_no;
struct visor_device *dev_info = NULL;
@@ -997,9 +998,7 @@ my_device_create(struct controlvm_message *inmsg)
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
- kfree(dev_info);
- dev_info = NULL;
- goto out_respond;
+ goto out_free_dev_info;
}
dev_info->visorchannel = visorchannel;
dev_info->channel_type_guid = cmd->create_device.data_type_uuid;
@@ -1007,12 +1006,29 @@ my_device_create(struct controlvm_message *inmsg)
spar_vhba_channel_protocol_uuid) == 0)
save_crash_message(inmsg, CRASH_DEV);
+ if (inmsg->hdr.flags.response_expected == 1) {
+ pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL);
+ if (!pmsg_hdr) {
+ rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
+ goto out_free_dev_info;
+ }
+
+ memcpy(pmsg_hdr, &inmsg->hdr,
+ sizeof(struct controlvm_message_header));
+ dev_info->pending_msg_hdr = pmsg_hdr;
+ }
+ /* Chipset_device_create will send response */
+ chipset_device_create(dev_info);
POSTCODE_LINUX_4(DEVICE_CREATE_EXIT_PC, dev_no, bus_no,
POSTCODE_SEVERITY_INFO);
+ return;
+
+out_free_dev_info:
+ kfree(dev_info);
+
out_respond:
- device_epilog(dev_info, segment_state_running,
- CONTROLVM_DEVICE_CREATE, &inmsg->hdr, rc,
- inmsg->hdr.flags.response_expected == 1, 1);
+ if (inmsg->hdr.flags.response_expected == 1)
+ device_responder(inmsg->hdr.id, &inmsg->hdr, rc);
}
static void