From: Don Zickus <dzic...@redhat.com>

This patch is the second wave of changes to the _epilog functions to
struct visor_device.

Straightforward conversion, nothing really complicated here other
than the nice cleanup because device is now known.

Signed-off-by: Don Zickus <dzic...@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.ro...@unisys.com>
---
 drivers/staging/unisys/visorbus/visorchipset.c | 35 +++++++++-----------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index c8f8b56..51d708f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1049,18 +1049,12 @@ device_responder(enum controlvm_id cmd_id, u32 bus_no, 
u32 dev_no, int response)
 }
 
 static void
-bus_epilog(u32 bus_no,
+bus_epilog(struct visor_device *bus_info,
           u32 cmd, struct controlvm_message_header *msg_hdr,
           int response, bool need_response)
 {
-       struct visorchipset_bus_info *bus_info;
        bool notified = false;
 
-       bus_info = bus_find(&bus_info_list, bus_no);
-
-       if (!bus_info)
-               return;
-
        if (need_response) {
                memcpy(&bus_info->pending_msg_hdr, msg_hdr,
                       sizeof(struct controlvm_message_header));
@@ -1073,13 +1067,13 @@ bus_epilog(u32 bus_no,
                switch (cmd) {
                case CONTROLVM_BUS_CREATE:
                        if (busdev_notifiers.bus_create) {
-                               (*busdev_notifiers.bus_create) (bus_no);
+                               (*busdev_notifiers.bus_create) (bus_info);
                                notified = true;
                        }
                        break;
                case CONTROLVM_BUS_DESTROY:
                        if (busdev_notifiers.bus_destroy) {
-                               (*busdev_notifiers.bus_destroy) (bus_no);
+                               (*busdev_notifiers.bus_destroy) (bus_info);
                                notified = true;
                        }
                        break;
@@ -1092,28 +1086,25 @@ bus_epilog(u32 bus_no,
                 */
                ;
        else
-               bus_responder(cmd, bus_no, response);
+               bus_responder(cmd, bus_info, response);
        up(&notifier_lock);
 }
 
 static void
-device_epilog(u32 bus_no, u32 dev_no, struct spar_segment_state state, u32 cmd,
-             struct controlvm_message_header *msg_hdr, int response,
+device_epilog(struct visor_device *dev_info, struct spar_segment_state state,
+             u32 cmd, struct controlvm_message_header *msg_hdr, int response,
              bool need_response, bool for_visorbus)
 {
        struct visorchipset_busdev_notifiers *notifiers;
        bool notified = false;
+       u32 bus_no = dev_info->chipset_bus_no;
+       u32 dev_no = dev_info->chipset_dev_no;
 
-       struct visorchipset_device_info *dev_info =
-               device_find(&dev_info_list, bus_no, dev_no);
        char *envp[] = {
                "SPARSP_DIAGPOOL_PAUSED_STATE = 1",
                NULL
        };
 
-       if (!dev_info)
-               return;
-
        notifiers = &busdev_notifiers;
 
        if (need_response) {
@@ -1128,7 +1119,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
                switch (cmd) {
                case CONTROLVM_DEVICE_CREATE:
                        if (notifiers->device_create) {
-                               (*notifiers->device_create) (bus_no, dev_no);
+                               (*notifiers->device_create) (dev_info);
                                notified = true;
                        }
                        break;
@@ -1138,8 +1129,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
                            state.operating ==
                                segment_state_running.operating) {
                                if (notifiers->device_resume) {
-                                       (*notifiers->device_resume) (bus_no,
-                                                                    dev_no);
+                                       (*notifiers->device_resume) (dev_info);
                                        notified = true;
                                }
                        }
@@ -1151,8 +1141,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
                                 * where server is lost
                                 */
                                if (notifiers->device_pause) {
-                                       (*notifiers->device_pause) (bus_no,
-                                                                   dev_no);
+                                       (*notifiers->device_pause) (dev_info);
                                        notified = true;
                                }
                        } else if (state.alive == segment_state_paused.alive &&
@@ -1174,7 +1163,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
                        break;
                case CONTROLVM_DEVICE_DESTROY:
                        if (notifiers->device_destroy) {
-                               (*notifiers->device_destroy) (bus_no, dev_no);
+                               (*notifiers->device_destroy) (dev_info);
                                notified = true;
                        }
                        break;
-- 
2.1.4

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to