mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-08-27 20:49:55 -04:00
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -112,7 +112,6 @@ typedef struct InputDeviceInfo {
|
||||
void *pvtData;
|
||||
DevAttr attrSet;
|
||||
DevAbility abilitySet;
|
||||
struct OsalMutex mutex;
|
||||
struct InputDeviceInfo *next;
|
||||
} InputDevice;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user