!210 fix up codex

Merge pull request !210 from 黄凯/master
This commit is contained in:
openharmony_ci
2021-08-30 05:06:48 +00:00
committed by Gitee
6 changed files with 18 additions and 4 deletions
+2 -1
View File
@@ -31,7 +31,7 @@ void PushOnePackage(InputDevice *inputDev, uint32_t type, uint32_t code, int32_t
HDF_LOGE("%s: parm is null", __func__);
return;
}
OsalMutexLock(&inputDev->mutex);
package.type = type;
package.code = code;
package.value = value;
@@ -65,4 +65,5 @@ void PushOnePackage(InputDevice *inputDev, uint32_t type, uint32_t code, int32_t
HdfSbufFlush(inputDev->pkgBuf);
inputDev->errFrameFlag = false;
}
OsalMutexUnlock(&inputDev->mutex);
}
+7
View File
@@ -167,6 +167,13 @@ 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);
@@ -335,8 +335,8 @@ void UnregisterInputDevice(InputDevice *inputDev)
}
HdfSBufRecycle(inputDev->eventBuf);
inputDev->eventBuf = NULL;
OsalMutexDestroy(&inputDev->mutex);
OsalMemFree(inputDev);
inputDev = NULL;
OsalMutexUnlock(&g_inputManager->mutex);
HDF_LOGI("%s: exit succ, devCount is %d", __func__, g_inputManager->devCount);
return;
@@ -112,6 +112,7 @@ typedef struct InputDeviceInfo {
void *pvtData;
DevAttr attrSet;
DevAbility abilitySet;
struct OsalMutex mutex;
struct InputDeviceInfo *next;
} InputDevice;
+1 -1
View File
@@ -23,7 +23,7 @@
int32_t KeyIrqHandle(uint16_t intGpioNum, void *data)
{
uint16_t gpioValue;
uint16_t gpioValue = 0;
KeyDriver *driver = (KeyDriver *)data;
if (driver == NULL) {
return HDF_FAILURE;
+6 -1
View File
@@ -294,7 +294,12 @@ static InputDevice *InputDeviceInstance(ChipDevice *chipDev)
inputDev->devType = chipDev->driver->boardCfg->attr.devType;
inputDev->devName = chipDev->driver->devName;
HDF_LOGI("%s: inputDev->devName = %s", __func__, inputDev->devName);
int32_t ret = OsalMutexInit(&inputDev->mutex);
if (ret != HDF_SUCCESS) {
HDF_LOGE("%s: Init mutex error", __func__);
OsalMemFree(inputDev);
return NULL;
}
return inputDev;
}