diff --git a/model/input/driver/hdf_input_device_manager.c b/model/input/driver/hdf_input_device_manager.c index 83aedce52e9bb409b6f00534e4e74bf7b7fcde42..975bdf3df1633ab64fffa21b15eaa6aff0acb414 100644 --- a/model/input/driver/hdf_input_device_manager.c +++ b/model/input/driver/hdf_input_device_manager.c @@ -38,7 +38,8 @@ uint32_t TouchPoll(struct file *filep, InputDevice *inputDev, poll_table *wait); static int32_t InputDevIoctl(struct file *filep, int32_t cmd, unsigned long arg) { int32_t ret; - InputDevice *inputdev = (InputDevice *)((struct drv_data*)filep->f_vnode->data)->priv; + struct drv_data *drvData = (struct drv_data *)filep->f_vnode->data; + InputDevice *inputdev = (InputDevice *)drvData->priv; if (inputdev == NULL) { return HDF_FAILURE; } @@ -57,7 +58,8 @@ static int32_t InputDevIoctl(struct file *filep, int32_t cmd, unsigned long arg) static int32_t InputDevOpen(struct file *filep) { - InputDevice *inputdev = (InputDevice *)((struct drv_data*)filep->f_vnode->data)->priv; + struct drv_data *drvData = (struct drv_data *)filep->f_vnode->data; + InputDevice *inputdev = (InputDevice *)drvData->priv; if (inputdev == NULL) { HDF_LOGE("%s: filep is null", __func__); return HDF_FAILURE; @@ -67,7 +69,8 @@ static int32_t InputDevOpen(struct file *filep) static int32_t InputDevClose(struct file *filep) { - InputDevice *inputdev = (InputDevice *)((struct drv_data*)filep->f_vnode->data)->priv; + struct drv_data *drvData = (struct drv_data *)filep->f_vnode->data; + InputDevice *inputdev = (InputDevice *)drvData->priv; if (inputdev == NULL) { HDF_LOGE("%s: inputdev is null", __func__); return HDF_FAILURE; @@ -79,7 +82,8 @@ static int32_t InputDevClose(struct file *filep) static int32_t InputDevPoll(struct file *filep, poll_table *wait) { uint32_t pollMask = 0; - InputDevice *inputdev = (InputDevice *)(InputDevice *)((struct drv_data*)filep->f_vnode->data)->priv; + struct drv_data *drvData = (struct drv_data *)filep->f_vnode->data; + InputDevice *inputdev = (InputDevice *)drvData->priv; switch (inputdev->devType) { case INDEV_TYPE_TOUCH: pollMask = TouchPoll(filep, inputdev, wait);