From: Greg Kroah-Hartman Date: Thu, 3 Mar 2011 02:28:52 +0000 (-0800) Subject: Staging: hv: hv_mouse: unwind the initialization process a bit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ced4810f9a86bb0324568052c6bf27292512b43;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Staging: hv: hv_mouse: unwind the initialization process a bit This unwinds the init call sequence a bit, as we don't need a callback pointer for a function that is already in this file. Cc: Hank Janssen Cc: K. Y. Srinivasan Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c index b438b0310770..5fc14a23b33e 100644 --- a/drivers/staging/hv/hv_mouse.c +++ b/drivers/staging/hv/hv_mouse.c @@ -62,11 +62,6 @@ struct mousevsc_drv_obj { }; -/* - * Interface - */ -int mouse_vsc_initialize(struct hv_driver *drv); - /* The maximum size of a synthetic input message. */ #define SYNTHHID_MAX_INPUT_REPORT_SIZE 16 @@ -347,16 +342,7 @@ static inline struct mousevsc_dev *FinalReleaseInputDevice(struct hv_device *Dev return inputDevice; } -/* - * - * Name: - * MousevscInitialize() - * - * Description: - * Main entry point - * - */ -int mouse_vsc_initialize(struct hv_driver *Driver) +static int mouse_vsc_initialize(struct hv_driver *Driver) { struct mousevsc_drv_obj *inputDriver = (struct mousevsc_drv_obj *)Driver; @@ -1054,39 +1040,6 @@ void mousevsc_reportdesc_callback(struct hv_device *dev, void *packet, u32 len) kfree(hid_dev); } -/* - * - * Name: mousevsc_drv_init() - * - * Desc: Driver initialization. - */ -int mousevsc_drv_init(int (*pfn_drv_init)(struct hv_driver *pfn_drv_init)) -{ - int ret = 0; - struct mousevsc_drv_obj *input_drv_obj = &g_mousevsc_drv.drv_obj; - struct driver_context *drv_ctx = &g_mousevsc_drv.drv_ctx; - - input_drv_obj->OnDeviceInfo = mousevsc_deviceinfo_callback; - input_drv_obj->OnInputReport = mousevsc_inputreport_callback; - input_drv_obj->OnReportDescriptor = mousevsc_reportdesc_callback; - - /* Callback to client driver to complete the initialization */ - pfn_drv_init(&input_drv_obj->Base); - - drv_ctx->driver.name = input_drv_obj->Base.name; - memcpy(&drv_ctx->class_id, &input_drv_obj->Base.dev_type, - sizeof(struct hv_guid)); - - drv_ctx->probe = mousevsc_probe; - drv_ctx->remove = mousevsc_remove; - - /* The driver belongs to vmbus */ - vmbus_child_driver_register(drv_ctx); - - return ret; -} - - int mousevsc_drv_exit_cb(struct device *dev, void *data) { struct device **curr = (struct device **)data; @@ -1130,13 +1083,29 @@ void mousevsc_drv_exit(void) static int __init mousevsc_init(void) { - int ret; + struct mousevsc_drv_obj *input_drv_obj = &g_mousevsc_drv.drv_obj; + struct driver_context *drv_ctx = &g_mousevsc_drv.drv_ctx; DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing."); - ret = mousevsc_drv_init(mouse_vsc_initialize); + input_drv_obj->OnDeviceInfo = mousevsc_deviceinfo_callback; + input_drv_obj->OnInputReport = mousevsc_inputreport_callback; + input_drv_obj->OnReportDescriptor = mousevsc_reportdesc_callback; - return ret; + /* Callback to client driver to complete the initialization */ + mouse_vsc_initialize(&input_drv_obj->Base); + + drv_ctx->driver.name = input_drv_obj->Base.name; + memcpy(&drv_ctx->class_id, &input_drv_obj->Base.dev_type, + sizeof(struct hv_guid)); + + drv_ctx->probe = mousevsc_probe; + drv_ctx->remove = mousevsc_remove; + + /* The driver belongs to vmbus */ + vmbus_child_driver_register(drv_ctx); + + return 0; } static void __exit mousevsc_exit(void)