Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: hv: remove OnChildDeviceAdd vmbus_driver callback

It's only ever set to one function, so just call that function instead.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+5 -18
+1 -3
drivers/staging/hv/vmbus.c
··· 57 57 */ 58 58 int VmbusChildDeviceAdd(struct hv_device *ChildDevice) 59 59 { 60 - struct vmbus_driver *vmbusDriver = (struct vmbus_driver *)gDriver; 61 - 62 - return vmbusDriver->OnChildDeviceAdd(gDevice, ChildDevice); 60 + return vmbus_child_device_register(gDevice, ChildDevice); 63 61 } 64 62 65 63 /*
-4
drivers/staging/hv/vmbus_api.h
··· 120 120 /* !! Must be the 1st field !! */ 121 121 /* FIXME if ^, then someone is doing somthing stupid */ 122 122 struct hv_driver Base; 123 - 124 - /* Set by the caller */ 125 - int (*OnChildDeviceAdd)(struct hv_device *RootDevice, 126 - struct hv_device *ChildDevice); 127 123 }; 128 124 129 125 int VmbusInitialize(struct hv_driver *drv);
+2 -10
drivers/staging/hv/vmbus_drv.c
··· 69 69 static void vmbus_device_release(struct device *device); 70 70 static void vmbus_bus_release(struct device *device); 71 71 72 - static int vmbus_child_device_register(struct hv_device *root_device_obj, 73 - struct hv_device *child_device_obj); 74 72 static ssize_t vmbus_show_device_attr(struct device *dev, 75 73 struct device_attribute *dev_attr, 76 74 char *buf); ··· 289 291 struct vm_device *dev_ctx = &g_vmbus_drv.device_ctx; 290 292 int ret; 291 293 unsigned int vector; 292 - 293 - /* 294 - * Set this up to allow lower layer to callback to add/remove child 295 - * devices on the bus 296 - */ 297 - vmbus_drv_obj->OnChildDeviceAdd = vmbus_child_device_register; 298 294 299 295 /* Call to bus driver to initialize */ 300 296 ret = drv_init(&vmbus_drv_obj->Base); ··· 522 530 /* 523 531 * vmbus_child_device_register - Register the child device on the specified bus 524 532 */ 525 - static int vmbus_child_device_register(struct hv_device *root_device_obj, 526 - struct hv_device *child_device_obj) 533 + int vmbus_child_device_register(struct hv_device *root_device_obj, 534 + struct hv_device *child_device_obj) 527 535 { 528 536 int ret = 0; 529 537 struct vm_device *root_device_ctx =
+2 -1
drivers/staging/hv/vmbus_private.h
··· 107 107 struct vmbus_channel *channel); 108 108 109 109 int VmbusChildDeviceAdd(struct hv_device *Device); 110 - 110 + int vmbus_child_device_register(struct hv_device *root_device_obj, 111 + struct hv_device *child_device_obj); 111 112 void vmbus_child_device_unregister(struct hv_device *device_obj); 112 113 113 114 /* static void */