mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-08-26 18:17:07 -04:00
@@ -23,6 +23,8 @@
|
||||
#define LIGHT_MAKE_B_BIT 0X00000080
|
||||
#define LIGHT_WAIT_TIME 50
|
||||
|
||||
#define LIGHT_ID_NUM 4
|
||||
|
||||
#define CHECK_LIGHT_NULL_PTR_RETURN_VALUE(ptr, ret) do { \
|
||||
if ((ptr) == NULL) { \
|
||||
HDF_LOGE("%s:line %d pointer is null and return ret", __func__, __LINE__); \
|
||||
@@ -62,12 +64,12 @@ enum LightState {
|
||||
LIGHT_STATE_BUTT,
|
||||
};
|
||||
|
||||
enum LightType {
|
||||
LIGHT_TYPE_NONE = 0,
|
||||
LIGHT_TYPE_BATTERY = 1,
|
||||
LIGHT_TYPE_NOTIFICATIONS = 2,
|
||||
LIGHT_TYPE_ATTENTION = 3,
|
||||
LIGHT_TYPE_BUTT,
|
||||
enum LightId {
|
||||
LIGHT_ID_NONE = 0,
|
||||
LIGHT_ID_BATTERY = 1,
|
||||
LIGHT_ID_NOTIFICATIONS = 2,
|
||||
LIGHT_ID_ATTENTION = 3,
|
||||
LIGHT_ID_BUTT,
|
||||
};
|
||||
|
||||
enum LightFlashMode {
|
||||
@@ -88,7 +90,7 @@ struct LightEffect {
|
||||
};
|
||||
|
||||
struct LightInfo {
|
||||
uint32_t lightType;
|
||||
uint32_t lightId;
|
||||
int32_t reserved;
|
||||
};
|
||||
|
||||
@@ -110,12 +112,12 @@ struct LightDriverData {
|
||||
HdfWork work;
|
||||
OsalTimer timer;
|
||||
struct OsalMutex mutex;
|
||||
uint32_t lightType;
|
||||
uint32_t lightId;
|
||||
uint32_t lightNum;
|
||||
struct LightDeviceInfo *info[LIGHT_TYPE_BUTT];
|
||||
struct LightDeviceInfo *info[LIGHT_ID_BUTT];
|
||||
};
|
||||
|
||||
typedef int32_t (*LightCmdHandle)(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf *reply);
|
||||
typedef int32_t (*LightCmdHandle)(uint32_t lightId, struct HdfSBuf *data, struct HdfSBuf *reply);
|
||||
|
||||
struct LightCmdHandleList {
|
||||
enum LightOpsCmd cmd;
|
||||
|
||||
@@ -40,11 +40,11 @@ static int32_t GetAllLightInfo(struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < LIGHT_TYPE_BUTT; ++i) {
|
||||
for (i = 0; i < LIGHT_ID_BUTT; ++i) {
|
||||
if (drvData->info[i] == NULL) {
|
||||
continue;
|
||||
}
|
||||
lightInfo.lightType = i;
|
||||
lightInfo.lightId = i;
|
||||
lightInfo.reserved = 0;
|
||||
|
||||
if (!HdfSbufWriteBuffer(reply, &lightInfo, sizeof(lightInfo))) {
|
||||
@@ -56,30 +56,30 @@ static int32_t GetAllLightInfo(struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t StartLight(uint32_t lightType)
|
||||
int32_t StartLight(uint32_t lightId)
|
||||
{
|
||||
struct LightDriverData *drvData = NULL;
|
||||
|
||||
drvData = GetLightDrvData();
|
||||
CHECK_LIGHT_NULL_PTR_RETURN_VALUE(drvData, HDF_ERR_INVALID_PARAM);
|
||||
|
||||
if (GpioWrite(drvData->info[lightType]->busNum, GPIO_VAL_HIGH) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: pull gpio%d to %d level failed", __func__, drvData->info[lightType]->busNum, GPIO_VAL_LOW);
|
||||
if (GpioWrite(drvData->info[lightId]->busNum, GPIO_VAL_HIGH) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: pull gpio%d to %d level failed", __func__, drvData->info[lightId]->busNum, GPIO_VAL_LOW);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t StopLight(uint32_t lightType)
|
||||
int32_t StopLight(uint32_t lightId)
|
||||
{
|
||||
struct LightDriverData *drvData = NULL;
|
||||
|
||||
drvData = GetLightDrvData();
|
||||
CHECK_LIGHT_NULL_PTR_RETURN_VALUE(drvData, HDF_ERR_INVALID_PARAM);
|
||||
|
||||
if (GpioWrite(drvData->info[lightType]->busNum, GPIO_VAL_LOW) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: pull gpio%d to %d level failed", __func__, drvData->info[lightType]->busNum, GPIO_VAL_LOW);
|
||||
if (GpioWrite(drvData->info[lightId]->busNum, GPIO_VAL_LOW) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: pull gpio%d to %d level failed", __func__, drvData->info[lightId]->busNum, GPIO_VAL_LOW);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
@@ -89,22 +89,23 @@ int32_t StopLight(uint32_t lightType)
|
||||
void LightTimerEntry(uintptr_t para)
|
||||
{
|
||||
uint32_t duration;
|
||||
uint32_t lightType;
|
||||
uint32_t lightId;
|
||||
struct LightDriverData *drvData = NULL;
|
||||
|
||||
drvData = GetLightDrvData();
|
||||
if (drvData == NULL) {
|
||||
HDF_LOGE("%s: drvData is null", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
lightType = (uint32_t)para;
|
||||
drvData->lightType = lightType;
|
||||
lightId = (uint32_t)para;
|
||||
drvData->lightId = lightId;
|
||||
|
||||
if (drvData->info[lightType]->lightState == LIGHT_STATE_START) {
|
||||
duration = drvData->info[lightType]->offTime;
|
||||
if (drvData->info[lightId]->lightState == LIGHT_STATE_START) {
|
||||
duration = drvData->info[lightId]->offTime;
|
||||
}
|
||||
if (drvData->info[lightType]->lightState == LIGHT_STATE_STOP) {
|
||||
duration = drvData->info[lightType]->onTime;
|
||||
if (drvData->info[lightId]->lightState == LIGHT_STATE_STOP) {
|
||||
duration = drvData->info[lightId]->onTime;
|
||||
}
|
||||
|
||||
HdfAddWork(&drvData->workQueue, &drvData->work);
|
||||
@@ -122,7 +123,7 @@ void LightTimerEntry(uintptr_t para)
|
||||
return;
|
||||
}
|
||||
|
||||
static int32_t Enable(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
static int32_t Enable(uint32_t lightId, struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
{
|
||||
(void)reply;
|
||||
uint32_t len;
|
||||
@@ -132,8 +133,8 @@ static int32_t Enable(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf *
|
||||
drvData = GetLightDrvData();
|
||||
CHECK_LIGHT_NULL_PTR_RETURN_VALUE(drvData, HDF_ERR_INVALID_PARAM);
|
||||
|
||||
if (drvData->info[lightType] == NULL) {
|
||||
HDF_LOGE("%s: light type info is null", __func__);
|
||||
if (drvData->info[lightId] == NULL) {
|
||||
HDF_LOGE("%s: light id info is null", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
@@ -142,31 +143,31 @@ static int32_t Enable(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf *
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
drvData->info[lightType]->lightBrightness = (buf->lightBrightness == 0) ?
|
||||
drvData->info[lightType]->lightBrightness : buf->lightBrightness;
|
||||
drvData->info[lightId]->lightBrightness = (buf->lightBrightness == 0) ?
|
||||
drvData->info[lightId]->lightBrightness : buf->lightBrightness;
|
||||
|
||||
if ((drvData->info[lightType]->lightBrightness & LIGHT_MAKE_R_BIT) != 0) {
|
||||
drvData->info[lightType]->busNum = drvData->info[lightType]->busRNum;
|
||||
} else if ((drvData->info[lightType]->lightBrightness & LIGHT_MAKE_G_BIT) != 0) {
|
||||
drvData->info[lightType]->busNum = drvData->info[lightType]->busGNum;
|
||||
} else if ((drvData->info[lightType]->lightBrightness & LIGHT_MAKE_B_BIT) != 0) {
|
||||
drvData->info[lightType]->busNum = drvData->info[lightType]->busBNum;
|
||||
if ((drvData->info[lightId]->lightBrightness & LIGHT_MAKE_R_BIT) != 0) {
|
||||
drvData->info[lightId]->busNum = drvData->info[lightId]->busRNum;
|
||||
} else if ((drvData->info[lightId]->lightBrightness & LIGHT_MAKE_G_BIT) != 0) {
|
||||
drvData->info[lightId]->busNum = drvData->info[lightId]->busGNum;
|
||||
} else if ((drvData->info[lightId]->lightBrightness & LIGHT_MAKE_B_BIT) != 0) {
|
||||
drvData->info[lightId]->busNum = drvData->info[lightId]->busBNum;
|
||||
}
|
||||
|
||||
if (buf->flashEffect.flashMode == LIGHT_FLASH_NONE) {
|
||||
if (GpioWrite(drvData->info[lightType]->busNum, GPIO_VAL_HIGH) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: gpio busNum %d write failed", __func__, drvData->info[lightType]->busNum);
|
||||
if (GpioWrite(drvData->info[lightId]->busNum, GPIO_VAL_HIGH) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: gpio busNum %d write failed", __func__, drvData->info[lightId]->busNum);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (buf->flashEffect.flashMode == LIGHT_FLASH_TIMED) {
|
||||
drvData->info[lightType]->onTime = (buf->flashEffect.onTime < drvData->info[lightType]->onTime) ?
|
||||
drvData->info[lightType]->onTime : buf->flashEffect.onTime;
|
||||
drvData->info[lightType]->offTime = (buf->flashEffect.offTime < drvData->info[lightType]->offTime) ?
|
||||
drvData->info[lightType]->offTime : buf->flashEffect.offTime;
|
||||
drvData->info[lightId]->onTime = (buf->flashEffect.onTime < drvData->info[lightId]->onTime) ?
|
||||
drvData->info[lightId]->onTime : buf->flashEffect.onTime;
|
||||
drvData->info[lightId]->offTime = (buf->flashEffect.offTime < drvData->info[lightId]->offTime) ?
|
||||
drvData->info[lightId]->offTime : buf->flashEffect.offTime;
|
||||
|
||||
if (OsalTimerCreate(&drvData->timer, LIGHT_WAIT_TIME, LightTimerEntry, (uintptr_t)lightType) != HDF_SUCCESS) {
|
||||
if (OsalTimerCreate(&drvData->timer, LIGHT_WAIT_TIME, LightTimerEntry, (uintptr_t)lightId) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: create light timer fail!", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
@@ -180,7 +181,7 @@ static int32_t Enable(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf *
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
static int32_t Disable(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
static int32_t Disable(uint32_t lightId, struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
{
|
||||
(void)data;
|
||||
(void)reply;
|
||||
@@ -189,8 +190,8 @@ static int32_t Disable(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf
|
||||
drvData = GetLightDrvData();
|
||||
CHECK_LIGHT_NULL_PTR_RETURN_VALUE(drvData, HDF_ERR_INVALID_PARAM);
|
||||
|
||||
if (drvData->info[lightType] == NULL) {
|
||||
HDF_LOGE("%s: light type info is null", __func__);
|
||||
if (drvData->info[lightId] == NULL) {
|
||||
HDF_LOGE("%s: light id info is null", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
@@ -201,12 +202,12 @@ static int32_t Disable(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf
|
||||
}
|
||||
}
|
||||
|
||||
if (GpioWrite(drvData->info[lightType]->busRNum, GPIO_VAL_LOW) != HDF_SUCCESS) {
|
||||
if (GpioWrite(drvData->info[lightId]->busRNum, GPIO_VAL_LOW) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: gpio write failed", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
drvData->info[lightType]->lightState = LIGHT_STATE_STOP;
|
||||
drvData->info[lightId]->lightState = LIGHT_STATE_STOP;
|
||||
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
@@ -216,7 +217,7 @@ static struct LightCmdHandleList g_lightCmdHandle[] = {
|
||||
{LIGHT_OPS_IO_CMD_DISABLE, Disable},
|
||||
};
|
||||
|
||||
static int32_t DispatchCmdHandle(uint32_t lightType, struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
static int32_t DispatchCmdHandle(uint32_t lightId, struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
{
|
||||
int32_t opsCmd;
|
||||
int32_t loop;
|
||||
@@ -237,7 +238,7 @@ static int32_t DispatchCmdHandle(uint32_t lightType, struct HdfSBuf *data, struc
|
||||
count = sizeof(g_lightCmdHandle) / sizeof(g_lightCmdHandle[0]);
|
||||
for (loop = 0; loop < count; ++loop) {
|
||||
if ((opsCmd == g_lightCmdHandle[loop].cmd) && (g_lightCmdHandle[loop].func != NULL)) {
|
||||
return g_lightCmdHandle[loop].func(lightType, data, reply);
|
||||
return g_lightCmdHandle[loop].func(lightId, data, reply);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +249,7 @@ static int32_t DispatchLight(struct HdfDeviceIoClient *client,
|
||||
int32_t cmd, struct HdfSBuf *data, struct HdfSBuf *reply)
|
||||
{
|
||||
int32_t ret;
|
||||
uint32_t lightType;
|
||||
uint32_t lightId;
|
||||
struct LightDriverData *drvData = NULL;
|
||||
|
||||
drvData = GetLightDrvData();
|
||||
@@ -267,19 +268,19 @@ static int32_t DispatchLight(struct HdfDeviceIoClient *client,
|
||||
|
||||
CHECK_LIGHT_NULL_PTR_RETURN_VALUE(data, HDF_ERR_INVALID_PARAM);
|
||||
(void)OsalMutexLock(&drvData->mutex);
|
||||
if (!HdfSbufReadUint32(data, &lightType)) {
|
||||
HDF_LOGE("%s: sbuf read lightType failed", __func__);
|
||||
if (!HdfSbufReadUint32(data, &lightId)) {
|
||||
HDF_LOGE("%s: sbuf read lightId failed", __func__);
|
||||
(void)OsalMutexUnlock(&drvData->mutex);
|
||||
return HDF_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if (lightType < LIGHT_TYPE_NONE || lightType >= LIGHT_TYPE_BUTT) {
|
||||
HDF_LOGE("%s: light type invalid para", __func__);
|
||||
if (lightId >= LIGHT_ID_BUTT) {
|
||||
HDF_LOGE("%s: light id invalid para", __func__);
|
||||
(void)OsalMutexUnlock(&drvData->mutex);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
ret = DispatchCmdHandle(lightType, data, reply);
|
||||
ret = DispatchCmdHandle(lightId, data, reply);
|
||||
(void)OsalMutexUnlock(&drvData->mutex);
|
||||
|
||||
return ret;
|
||||
@@ -298,22 +299,22 @@ static int32_t ParseLightInfo(const struct DeviceResourceNode *node, const struc
|
||||
CHECK_LIGHT_NULL_PTR_RETURN_VALUE(node, HDF_ERR_INVALID_PARAM);
|
||||
CHECK_LIGHT_NULL_PTR_RETURN_VALUE(parser, HDF_ERR_INVALID_PARAM);
|
||||
|
||||
drvData->lightNum = (uint32_t)parser->GetElemNum(node, "lightType");
|
||||
if (drvData->lightNum > LIGHT_TYPE_BUTT || drvData->lightNum < LIGHT_TYPE_NONE) {
|
||||
drvData->lightNum = (uint32_t)parser->GetElemNum(node, "lightId");
|
||||
if (drvData->lightNum > LIGHT_ID_NUM) {
|
||||
HDF_LOGE("%s: lightNum cross the border", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
ret = memset_s(drvData->info, sizeof(drvData->info[LIGHT_TYPE_NONE]) * LIGHT_TYPE_BUTT, 0,
|
||||
sizeof(drvData->info[LIGHT_TYPE_NONE]) * LIGHT_TYPE_BUTT);
|
||||
ret = memset_s(drvData->info, sizeof(drvData->info[LIGHT_ID_NONE]) * LIGHT_ID_BUTT, 0,
|
||||
sizeof(drvData->info[LIGHT_ID_NONE]) * LIGHT_ID_BUTT);
|
||||
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "memset_s");
|
||||
|
||||
for (i = 0; i < drvData->lightNum; ++i) {
|
||||
ret = parser->GetUint32ArrayElem(node, "lightType", i, &temp, 0);
|
||||
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "lightType");
|
||||
ret = parser->GetUint32ArrayElem(node, "lightId", i, &temp, 0);
|
||||
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "lightId");
|
||||
|
||||
if (temp < LIGHT_TYPE_NONE || temp >= LIGHT_TYPE_BUTT) {
|
||||
HDF_LOGE("%s: light type invalid para", __func__);
|
||||
if (temp >= LIGHT_ID_BUTT) {
|
||||
HDF_LOGE("%s: light id invalid para", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
@@ -337,12 +338,6 @@ static int32_t ParseLightInfo(const struct DeviceResourceNode *node, const struc
|
||||
ret = parser->GetUint32(node, "offTime", &drvData->info[temp]->offTime, 0);
|
||||
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "offTime");
|
||||
|
||||
if (drvData->info[temp]->offTime < 0 || drvData->info[temp]->onTime < 0 || drvData->info[temp]->busRNum < 0 ||
|
||||
drvData->info[temp]->busGNum < 0 || drvData->info[temp]->busBNum < 0) {
|
||||
HDF_LOGE("%s: offtime Invalid parameter", __func__);
|
||||
return HDF_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
drvData->info[temp]->lightState = LIGHT_STATE_STOP;
|
||||
}
|
||||
|
||||
@@ -393,29 +388,29 @@ int32_t BindLightDriver(struct HdfDeviceObject *device)
|
||||
|
||||
static void LightWorkEntry(void *para)
|
||||
{
|
||||
uint32_t lightType;
|
||||
uint32_t lightId;
|
||||
struct LightDriverData *drvData = (struct LightDriverData *)para;
|
||||
CHECK_LIGHT_NULL_PTR_RETURN(drvData);
|
||||
lightType = drvData->lightType;
|
||||
lightId = drvData->lightId;
|
||||
|
||||
if (drvData->info[lightType] == NULL) {
|
||||
HDF_LOGE("%s: lightType info is NULL!", __func__);
|
||||
if (drvData->info[lightId] == NULL) {
|
||||
HDF_LOGE("%s: lightId info is NULL!", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (drvData->info[lightType]->lightState == LIGHT_STATE_START) {
|
||||
if (StopLight(lightType) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: add light work fail! device state[%d]!", __func__, drvData->info[lightType]->lightState);
|
||||
if (drvData->info[lightId]->lightState == LIGHT_STATE_START) {
|
||||
if (StopLight(lightId) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: add light work fail! device state[%d]!", __func__, drvData->info[lightId]->lightState);
|
||||
}
|
||||
drvData->info[lightType]->lightState = LIGHT_STATE_STOP;
|
||||
drvData->info[lightId]->lightState = LIGHT_STATE_STOP;
|
||||
return;
|
||||
}
|
||||
|
||||
if (drvData->info[lightType]->lightState == LIGHT_STATE_STOP) {
|
||||
if (StartLight(lightType) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: add light work fail! device state[%d]!", __func__, drvData->info[lightType]->lightState);
|
||||
if (drvData->info[lightId]->lightState == LIGHT_STATE_STOP) {
|
||||
if (StartLight(lightId) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: add light work fail! device state[%d]!", __func__, drvData->info[lightId]->lightState);
|
||||
}
|
||||
drvData->info[lightType]->lightState = LIGHT_STATE_START;
|
||||
drvData->info[lightId]->lightState = LIGHT_STATE_START;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -439,7 +434,7 @@ int32_t InitLightDriver(struct HdfDeviceObject *device)
|
||||
}
|
||||
|
||||
if (HdfWorkInit(&drvData->work, LightWorkEntry, (void*)drvData) != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: init workQueue fail!", __func__);
|
||||
HDF_LOGE("%s: init work fail!", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
@@ -453,7 +448,7 @@ int32_t InitLightDriver(struct HdfDeviceObject *device)
|
||||
|
||||
void ReleaseLightDriver(struct HdfDeviceObject *device)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
struct LightDriverData *drvData = NULL;
|
||||
|
||||
if (device == NULL) {
|
||||
@@ -467,7 +462,7 @@ void ReleaseLightDriver(struct HdfDeviceObject *device)
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = LIGHT_TYPE_NONE; i < LIGHT_TYPE_BUTT; ++i) {
|
||||
for (i = LIGHT_ID_NONE; i < LIGHT_ID_BUTT; ++i) {
|
||||
if (drvData->info[i] != NULL) {
|
||||
OsalMemFree(drvData->info[i]);
|
||||
drvData->info[i] = NULL;
|
||||
@@ -477,7 +472,7 @@ void ReleaseLightDriver(struct HdfDeviceObject *device)
|
||||
HdfWorkDestroy(&drvData->work);
|
||||
HdfWorkQueueDestroy(&drvData->workQueue);
|
||||
(void)OsalMutexDestroy(&drvData->mutex);
|
||||
(void)OsalMemFree(drvData);
|
||||
OsalMemFree(drvData);
|
||||
g_lightDrvData = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user