staging: unisys: visorbus: Get rid of passthrough function visorchipset_device_create
authorSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Tue, 22 Aug 2017 17:27:34 +0000 (13:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Aug 2017 22:14:55 +0000 (15:14 -0700)
The function visorchipset_device_create just called create_visor_device,
we can just combine it with create_visor_device.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
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>
drivers/staging/unisys/visorbus/visorbus_main.c
drivers/staging/unisys/visorbus/visorbus_private.h
drivers/staging/unisys/visorbus/visorchipset.c

index a3fde23dc03ae27fedcd3744a6c32bec0b6316ad..1c037a3149ee2e1659d99bd3ea4faa9db8600acc 100644 (file)
@@ -658,7 +658,7 @@ EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts);
  * Return: 0 if successful, otherwise the negative value returned by
  *         device_add() indicating the reason for failure
  */
-static int create_visor_device(struct visor_device *dev)
+int create_visor_device(struct visor_device *dev)
 {
        int err;
        u32 chipset_bus_no = dev->chipset_bus_no;
@@ -705,6 +705,8 @@ static int create_visor_device(struct visor_device *dev)
                goto err_put;
 
        list_add_tail(&dev->list_all, &list_all_device_instances);
+       dev->state.created = 1;
+       visorbus_response(dev, err, CONTROLVM_DEVICE_CREATE);
        /* success: reference kept via unmatched get_device() */
        return 0;
 
@@ -1117,20 +1119,6 @@ static void remove_all_visor_devices(void)
        }
 }
 
-int visorchipset_device_create(struct visor_device *dev_info)
-{
-       int err;
-
-       err = create_visor_device(dev_info);
-       if (err < 0)
-               return err;
-
-       visorbus_response(dev_info, err, CONTROLVM_DEVICE_CREATE);
-       dev_info->state.created = 1;
-
-       return 0;
-}
-
 void visorchipset_device_destroy(struct visor_device *dev_info)
 {
        remove_visor_device(dev_info);
index 929e09b28a71985988166abfb3c1236bbaac8ab0..56c38d5589714e3a57da2224388045a04dcf76dc 100644 (file)
@@ -25,7 +25,7 @@
 
 int visorbus_create_instance(struct visor_device *dev);
 void visorbus_remove_instance(struct visor_device *bus_info);
-int visorchipset_device_create(struct visor_device *dev_info);
+int create_visor_device(struct visor_device *dev_info);
 void visorchipset_device_destroy(struct visor_device *dev_info);
 int visorchipset_device_pause(struct visor_device *dev_info);
 int visorchipset_device_resume(struct visor_device *dev_info);
index a478533a231c12ac03167a0e03afb25a58737d1b..153c7e5ad79a94080d509ba5d4a8363c0cba05fe 100644 (file)
@@ -833,8 +833,8 @@ static int visorbus_device_create(struct controlvm_message *inmsg)
                       sizeof(struct controlvm_message_header));
                dev_info->pending_msg_hdr = pmsg_hdr;
        }
-       /* visorchipset_device_create will send response */
-       err = visorchipset_device_create(dev_info);
+       /* create_visor_device will send response */
+       err = create_visor_device(dev_info);
        if (err)
                goto err_destroy_visorchannel;