diff --git a/model/input/driver/event_hub.c b/model/input/driver/event_hub.c index 3055b95e169a59e6395838d46ca006d2295c07fb..8fd3233692db2ff1b578f22e3d9ddd3d2eabc5be 100644 --- a/model/input/driver/event_hub.c +++ b/model/input/driver/event_hub.c @@ -26,12 +26,13 @@ void PushOnePackage(InputDevice *inputDev, uint32_t type, uint32_t code, int32_t { OsalTimespec time; EventPackage package = {0}; + InputManager *g_inputManager = GetInputManager(); if (inputDev == NULL) { HDF_LOGE("%s: parm is null", __func__); return; } - OsalMutexLock(&inputDev->mutex); + OsalMutexLock(&g_inputManager->mutex); package.type = type; package.code = code; package.value = value; @@ -65,5 +66,5 @@ void PushOnePackage(InputDevice *inputDev, uint32_t type, uint32_t code, int32_t HdfSbufFlush(inputDev->pkgBuf); inputDev->errFrameFlag = false; } - OsalMutexUnlock(&inputDev->mutex); + OsalMutexUnlock(&g_inputManager->mutex); } \ No newline at end of file diff --git a/model/input/driver/hdf_hid_adapter.c b/model/input/driver/hdf_hid_adapter.c index 3ebda661b6c20d1a89d87547c1a337a9b908f1e9..3b28428225340206f9a52728de08d9844ce446ff 100644 --- a/model/input/driver/hdf_hid_adapter.c +++ b/model/input/driver/hdf_hid_adapter.c @@ -188,13 +188,6 @@ static InputDevice* HidConstructInputDev(HidInfo *info) } (void)memset_s(inputDev, sizeof(InputDevice), 0, sizeof(InputDevice)); - int32_t ret = OsalMutexInit(&inputDev->mutex); - if (ret != HDF_SUCCESS) { - HDF_LOGE("%s: Init mutex error", __func__); - OsalMemFree(inputDev); - return NULL; - } - inputDev->devType = info->devType; inputDev->devName = info->devName; SetInputDevAbility(inputDev); diff --git a/model/input/driver/hdf_input_device_manager.c b/model/input/driver/hdf_input_device_manager.c index 9be0cce56e19eaeb8409ae4bc6f32f66e940eada..c9fcaa95a3859c45aabd5ee353c07835edd704a1 100644 --- a/model/input/driver/hdf_input_device_manager.c +++ b/model/input/driver/hdf_input_device_manager.c @@ -344,7 +344,6 @@ void UnregisterInputDevice(InputDevice *inputDev) } HdfSBufRecycle(inputDev->eventBuf); inputDev->eventBuf = NULL; - OsalMutexDestroy(&inputDev->mutex); OsalMemFree(inputDev); OsalMutexUnlock(&g_inputManager->mutex); HDF_LOGI("%s: exit succ, devCount is %d", __func__, g_inputManager->devCount); diff --git a/model/input/driver/hdf_input_device_manager.h b/model/input/driver/hdf_input_device_manager.h index 98d247d88b91cef0c54e753daf958bfe448e790e..35f454548cd27ef86554f2c0704ef470b119dd6c 100644 --- a/model/input/driver/hdf_input_device_manager.h +++ b/model/input/driver/hdf_input_device_manager.h @@ -112,7 +112,6 @@ typedef struct InputDeviceInfo { void *pvtData; DevAttr attrSet; DevAbility abilitySet; - struct OsalMutex mutex; struct InputDeviceInfo *next; } InputDevice; diff --git a/model/input/driver/hdf_touch.c b/model/input/driver/hdf_touch.c index 9a1264e393bec4854021d7f5dc36725aee575fba..9f67dea5038e6e04660132fbc5c5f8ffae9c4999 100644 --- a/model/input/driver/hdf_touch.c +++ b/model/input/driver/hdf_touch.c @@ -294,12 +294,6 @@ static InputDevice *InputDeviceInstance(ChipDevice *chipDev) inputDev->devType = chipDev->driver->boardCfg->attr.devType; inputDev->devName = chipDev->driver->devName; - int32_t ret = OsalMutexInit(&inputDev->mutex); - if (ret != HDF_SUCCESS) { - HDF_LOGE("%s: Init mutex error", __func__); - OsalMemFree(inputDev); - return NULL; - } return inputDev; }