mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-07-22 20:25:47 -04:00
@@ -114,12 +114,10 @@ static int32_t SetInputDevAbsAttr(InputDevice *inputDev, HidInfo *info)
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
static void SetInputDevAbility(InputDevice *inputDev)
|
||||
static int32_t GetInfoFromCache(HidInfo *info)
|
||||
{
|
||||
HidInfo *info = NULL;
|
||||
int32_t id = 0;
|
||||
uint32_t len;
|
||||
int32_t ret;
|
||||
int32_t id = 0;
|
||||
while (id < MAX_INPUT_DEV_NUM) {
|
||||
if(g_cachedInfo[id] != NULL && !strcmp(inputDev->devName, g_cachedInfo[id]->devName)) {
|
||||
info = g_cachedInfo[id];
|
||||
@@ -129,8 +127,19 @@ static void SetInputDevAbility(InputDevice *inputDev)
|
||||
}
|
||||
if (id == MAX_INPUT_DEV_NUM || info == NULL) {
|
||||
HDF_LOGE("%s: match cached info failed", __func__);
|
||||
return;
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
static void SetInputDevAbility(InputDevice *inputDev)
|
||||
{
|
||||
HidInfo *info = NULL;
|
||||
uint32_t len;
|
||||
int32_t ret;
|
||||
|
||||
ret = GetInfoFromCache(info);
|
||||
MEMCPY_CHECK_RETURN(ret);
|
||||
len = sizeof(unsigned long);
|
||||
ret = memcpy_s(inputDev->abilitySet.devProp, len * BITS_TO_LONG(INPUT_PROP_CNT),
|
||||
info->devProp, len * BITS_TO_LONG(INPUT_PROP_CNT));
|
||||
|
||||
Reference in New Issue
Block a user