[PATCH 363/510] Staging: hv: remove OnChildDeviceAdd vmbus_driver callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Cc: Hank Janssen <hjanssen@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/staging/hv/vmbus.c         |    4 +---
 drivers/staging/hv/vmbus_api.h     |    4 ----
 drivers/staging/hv/vmbus_drv.c     |   12 ++----------
 drivers/staging/hv/vmbus_private.h |    3 ++-
 4 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/hv/vmbus.c b/drivers/staging/hv/vmbus.c
index ae9e298..7a7454c 100644
--- a/drivers/staging/hv/vmbus.c
+++ b/drivers/staging/hv/vmbus.c
@@ -57,9 +57,7 @@ static struct hv_device *gDevice; /* vmbus root device */
  */
 int VmbusChildDeviceAdd(struct hv_device *ChildDevice)
 {
-	struct vmbus_driver *vmbusDriver = (struct vmbus_driver *)gDriver;
-
-	return vmbusDriver->OnChildDeviceAdd(gDevice, ChildDevice);
+	return vmbus_child_device_register(gDevice, ChildDevice);
 }
 
 /*
diff --git a/drivers/staging/hv/vmbus_api.h b/drivers/staging/hv/vmbus_api.h
index c85d7d4..6f3d59c 100644
--- a/drivers/staging/hv/vmbus_api.h
+++ b/drivers/staging/hv/vmbus_api.h
@@ -120,10 +120,6 @@ struct vmbus_driver {
 	/* !! Must be the 1st field !! */
 	/* FIXME if ^, then someone is doing somthing stupid */
 	struct hv_driver Base;
-
-	/* Set by the caller */
-	int (*OnChildDeviceAdd)(struct hv_device *RootDevice,
-				struct hv_device *ChildDevice);
 };
 
 int VmbusInitialize(struct hv_driver *drv);
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 6de53c4..4fa23c9 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -69,8 +69,6 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id);
 static void vmbus_device_release(struct device *device);
 static void vmbus_bus_release(struct device *device);
 
-static int vmbus_child_device_register(struct hv_device *root_device_obj,
-				       struct hv_device *child_device_obj);
 static ssize_t vmbus_show_device_attr(struct device *dev,
 				      struct device_attribute *dev_attr,
 				      char *buf);
@@ -292,12 +290,6 @@ static int vmbus_bus_init(int (*drv_init)(struct hv_driver *drv))
 	int ret;
 	unsigned int vector;
 
-	/*
-	 * Set this up to allow lower layer to callback to add/remove child
-	 * devices on the bus
-	 */
-	vmbus_drv_obj->OnChildDeviceAdd = vmbus_child_device_register;
-
 	/* Call to bus driver to initialize */
 	ret = drv_init(&vmbus_drv_obj->Base);
 	if (ret != 0) {
@@ -530,8 +522,8 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
 /*
  * vmbus_child_device_register - Register the child device on the specified bus
  */
-static int vmbus_child_device_register(struct hv_device *root_device_obj,
-				       struct hv_device *child_device_obj)
+int vmbus_child_device_register(struct hv_device *root_device_obj,
+				struct hv_device *child_device_obj)
 {
 	int ret = 0;
 	struct vm_device *root_device_ctx =
diff --git a/drivers/staging/hv/vmbus_private.h b/drivers/staging/hv/vmbus_private.h
index a5965f8..07f6d22 100644
--- a/drivers/staging/hv/vmbus_private.h
+++ b/drivers/staging/hv/vmbus_private.h
@@ -107,7 +107,8 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *deviceType,
 					 struct vmbus_channel *channel);
 
 int VmbusChildDeviceAdd(struct hv_device *Device);
-
+int vmbus_child_device_register(struct hv_device *root_device_obj,
+				struct hv_device *child_device_obj);
 void vmbus_child_device_unregister(struct hv_device *device_obj);
 
 /* static void */
-- 
1.7.3.2

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


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux