Commit 4f143134 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: hv_mouse.c: remove struct mousevsc_drv_obj function callbacks

They aren't needed at all either because they are never called (OnOpen,
OnClose), or because we can just call the real function instead as it's
never set to anything else.

Just another step in unwinding the callback mess...

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7ced4810
...@@ -44,21 +44,9 @@ struct input_dev_info { ...@@ -44,21 +44,9 @@ struct input_dev_info {
}; };
/* Represents the input vsc driver */ /* Represents the input vsc driver */
/* FIXME - can be removed entirely */
struct mousevsc_drv_obj { struct mousevsc_drv_obj {
struct hv_driver Base; // Must be the first field struct hv_driver Base;
/*
* This is set by the caller to allow us to callback when
* we receive a packet from the "wire"
*/
void (*OnDeviceInfo)(struct hv_device *dev,
struct input_dev_info* info);
void (*OnInputReport)(struct hv_device *dev, void* packet, u32 len);
void (*OnReportDescriptor)(struct hv_device *dev,
void* packet, u32 len);
/* Specific to this driver */
int (*OnOpen)(struct hv_device *Device);
int (*OnClose)(struct hv_device *Device);
void *Context;
}; };
...@@ -230,6 +218,10 @@ static int MousevscConnectToVsp(struct hv_device *Device); ...@@ -230,6 +218,10 @@ static int MousevscConnectToVsp(struct hv_device *Device);
static void MousevscOnReceive(struct hv_device *Device, static void MousevscOnReceive(struct hv_device *Device,
struct vmpacket_descriptor *Packet); struct vmpacket_descriptor *Packet);
static void deviceinfo_callback(struct hv_device *dev, struct input_dev_info *info);
static void inputreport_callback(struct hv_device *dev, void *packet, u32 len);
static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
static inline struct mousevsc_dev *AllocInputDevice(struct hv_device *Device) static inline struct mousevsc_dev *AllocInputDevice(struct hv_device *Device)
{ {
struct mousevsc_dev *inputDevice; struct mousevsc_dev *inputDevice;
...@@ -357,9 +349,6 @@ static int mouse_vsc_initialize(struct hv_driver *Driver) ...@@ -357,9 +349,6 @@ static int mouse_vsc_initialize(struct hv_driver *Driver)
inputDriver->Base.dev_rm = MousevscOnDeviceRemove; inputDriver->Base.dev_rm = MousevscOnDeviceRemove;
inputDriver->Base.cleanup = MousevscOnCleanup; inputDriver->Base.cleanup = MousevscOnCleanup;
inputDriver->OnOpen = NULL;
inputDriver->OnClose = NULL;
return ret; return ret;
} }
...@@ -423,14 +412,15 @@ MousevscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) ...@@ -423,14 +412,15 @@ MousevscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
strcpy(deviceInfo.Name, "Microsoft Vmbus HID-compliant Mouse"); strcpy(deviceInfo.Name, "Microsoft Vmbus HID-compliant Mouse");
/* Send the device info back up */ /* Send the device info back up */
inputDriver->OnDeviceInfo(Device, &deviceInfo); deviceinfo_callback(Device, &deviceInfo);
/* Send the report desc back up */ /* Send the report desc back up */
/* workaround SA-167 */ /* workaround SA-167 */
if (inputDevice->ReportDesc[14] == 0x25) if (inputDevice->ReportDesc[14] == 0x25)
inputDevice->ReportDesc[14] = 0x29; inputDevice->ReportDesc[14] = 0x29;
inputDriver->OnReportDescriptor(Device, inputDevice->ReportDesc, inputDevice->ReportDescSize); reportdesc_callback(Device, inputDevice->ReportDesc,
inputDevice->ReportDescSize);
inputDevice->bInitializeComplete = true; inputDevice->bInitializeComplete = true;
...@@ -710,9 +700,9 @@ MousevscOnReceiveInputReport( ...@@ -710,9 +700,9 @@ MousevscOnReceiveInputReport(
inputDriver = (struct mousevsc_drv_obj *)InputDevice->Device->drv; inputDriver = (struct mousevsc_drv_obj *)InputDevice->Device->drv;
inputDriver->OnInputReport(InputDevice->Device, inputreport_callback(InputDevice->Device,
InputReport->ReportBuffer, InputReport->ReportBuffer,
InputReport->Header.Size); InputReport->Header.Size);
} }
void void
...@@ -875,8 +865,8 @@ struct mousevsc_driver_context { ...@@ -875,8 +865,8 @@ struct mousevsc_driver_context {
static struct mousevsc_driver_context g_mousevsc_drv; static struct mousevsc_driver_context g_mousevsc_drv;
void mousevsc_deviceinfo_callback(struct hv_device *dev, static void deviceinfo_callback(struct hv_device *dev,
struct input_dev_info *info) struct input_dev_info *info)
{ {
struct vm_device *device_ctx = to_vm_device(dev); struct vm_device *device_ctx = to_vm_device(dev);
struct input_device_context *input_device_ctx = struct input_device_context *input_device_ctx =
...@@ -885,10 +875,10 @@ void mousevsc_deviceinfo_callback(struct hv_device *dev, ...@@ -885,10 +875,10 @@ void mousevsc_deviceinfo_callback(struct hv_device *dev,
memcpy(&input_device_ctx->device_info, info, memcpy(&input_device_ctx->device_info, info,
sizeof(struct input_dev_info)); sizeof(struct input_dev_info));
DPRINT_INFO(INPUTVSC_DRV, "mousevsc_deviceinfo_callback()"); DPRINT_INFO(INPUTVSC_DRV, "%s", __func__);
} }
void mousevsc_inputreport_callback(struct hv_device *dev, void *packet, u32 len) static void inputreport_callback(struct hv_device *dev, void *packet, u32 len)
{ {
int ret = 0; int ret = 0;
...@@ -986,7 +976,7 @@ int mousevsc_remove(struct device *device) ...@@ -986,7 +976,7 @@ int mousevsc_remove(struct device *device)
return ret; return ret;
} }
void mousevsc_reportdesc_callback(struct hv_device *dev, void *packet, u32 len) static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
{ {
struct vm_device *device_ctx = to_vm_device(dev); struct vm_device *device_ctx = to_vm_device(dev);
struct input_device_context *input_device_ctx = struct input_device_context *input_device_ctx =
...@@ -1088,10 +1078,6 @@ static int __init mousevsc_init(void) ...@@ -1088,10 +1078,6 @@ static int __init mousevsc_init(void)
DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing."); DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing.");
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 */ /* Callback to client driver to complete the initialization */
mouse_vsc_initialize(&input_drv_obj->Base); mouse_vsc_initialize(&input_drv_obj->Base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment