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

staging: unisys: visorchipset_init(): Simplify initial checks

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 fa2cc0af
...@@ -1474,15 +1474,14 @@ initialize_controlvm_payload(void) ...@@ -1474,15 +1474,14 @@ initialize_controlvm_payload(void)
/* Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset. /* Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset.
* Returns CONTROLVM_RESP_xxx code. * Returns CONTROLVM_RESP_xxx code.
*/ */
int static int
visorchipset_chipset_ready(void) visorchipset_chipset_ready(void)
{ {
kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_ONLINE); kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_ONLINE);
return CONTROLVM_RESP_SUCCESS; return CONTROLVM_RESP_SUCCESS;
} }
EXPORT_SYMBOL_GPL(visorchipset_chipset_ready);
int static int
visorchipset_chipset_selftest(void) visorchipset_chipset_selftest(void)
{ {
char env_selftest[20]; char env_selftest[20];
...@@ -1493,18 +1492,16 @@ visorchipset_chipset_selftest(void) ...@@ -1493,18 +1492,16 @@ visorchipset_chipset_selftest(void)
envp); envp);
return CONTROLVM_RESP_SUCCESS; return CONTROLVM_RESP_SUCCESS;
} }
EXPORT_SYMBOL_GPL(visorchipset_chipset_selftest);
/* Send ACTION=offline for DEVPATH=/sys/devices/platform/visorchipset. /* Send ACTION=offline for DEVPATH=/sys/devices/platform/visorchipset.
* Returns CONTROLVM_RESP_xxx code. * Returns CONTROLVM_RESP_xxx code.
*/ */
int static int
visorchipset_chipset_notready(void) visorchipset_chipset_notready(void)
{ {
kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_OFFLINE); kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_OFFLINE);
return CONTROLVM_RESP_SUCCESS; return CONTROLVM_RESP_SUCCESS;
} }
EXPORT_SYMBOL_GPL(visorchipset_chipset_notready);
static void static void
chipset_ready(struct controlvm_message_header *msg_hdr) chipset_ready(struct controlvm_message_header *msg_hdr)
...@@ -2099,14 +2096,13 @@ device_destroy_response(u32 bus_no, u32 dev_no, int response) ...@@ -2099,14 +2096,13 @@ device_destroy_response(u32 bus_no, u32 dev_no, int response)
device_responder(CONTROLVM_DEVICE_DESTROY, bus_no, dev_no, response); device_responder(CONTROLVM_DEVICE_DESTROY, bus_no, dev_no, response);
} }
void static void
visorchipset_device_pause_response(u32 bus_no, u32 dev_no, int response) visorchipset_device_pause_response(u32 bus_no, u32 dev_no, int response)
{ {
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE, device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
bus_no, dev_no, response, bus_no, dev_no, response,
segment_state_standby); segment_state_standby);
} }
EXPORT_SYMBOL_GPL(visorchipset_device_pause_response);
static void static void
device_resume_response(u32 bus_no, u32 dev_no, int response) device_resume_response(u32 bus_no, u32 dev_no, int response)
...@@ -2327,18 +2323,19 @@ visorchipset_init(struct acpi_device *acpi_device) ...@@ -2327,18 +2323,19 @@ visorchipset_init(struct acpi_device *acpi_device)
{ {
int rc = 0; int rc = 0;
u64 addr; u64 addr;
int tmp_sz = sizeof(struct spar_controlvm_channel_protocol);
uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
addr = controlvm_get_channel_address();
if (!addr)
return -ENODEV;
memset(&busdev_notifiers, 0, sizeof(busdev_notifiers)); memset(&busdev_notifiers, 0, sizeof(busdev_notifiers));
memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info)); memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
memset(&livedump_info, 0, sizeof(livedump_info)); memset(&livedump_info, 0, sizeof(livedump_info));
atomic_set(&livedump_info.buffers_in_use, 0); atomic_set(&livedump_info.buffers_in_use, 0);
addr = controlvm_get_channel_address(); controlvm_channel = visorchannel_create_with_lock(addr, tmp_sz,
if (addr) {
int tmp_sz = sizeof(struct spar_controlvm_channel_protocol);
uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
controlvm_channel =
visorchannel_create_with_lock(addr, tmp_sz,
GFP_KERNEL, uuid); GFP_KERNEL, uuid);
if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT( if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
visorchannel_get_header(controlvm_channel))) { visorchannel_get_header(controlvm_channel))) {
...@@ -2348,9 +2345,6 @@ visorchipset_init(struct acpi_device *acpi_device) ...@@ -2348,9 +2345,6 @@ visorchipset_init(struct acpi_device *acpi_device)
controlvm_channel = NULL; controlvm_channel = NULL;
return -ENODEV; return -ENODEV;
} }
} else {
return -ENODEV;
}
major_dev = MKDEV(visorchipset_major, 0); major_dev = MKDEV(visorchipset_major, 0);
rc = visorchipset_file_init(major_dev, &controlvm_channel); rc = visorchipset_file_init(major_dev, &controlvm_channel);
......
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