Lines Matching refs:priv
63 struct LightDevice *priv = GetLightDevicePriv();
65 if (priv->ioService == NULL || priv->ioService->dispatcher == NULL ||
66 priv->ioService->dispatcher->Dispatch == NULL) {
71 int32_t ret = priv->ioService->dispatcher->Dispatch(&priv->ioService->object, cmd, msg, reply);
80 static int32_t ReadLightInfo(struct HdfSBuf *reply, struct LightDevice *priv)
85 if (!HdfSbufReadUint32(reply, &priv->lightNum)) {
90 if (priv->lightInfoEntry != NULL) {
91 OsalMemFree(priv->lightInfoEntry);
92 priv->lightInfoEntry = NULL;
95 priv->lightInfoEntry = (struct LightInfo *)OsalMemCalloc(sizeof(*priv->lightInfoEntry) * priv->lightNum);
96 if (priv->lightInfoEntry == NULL) {
101 pos = priv->lightInfoEntry;
103 for (uint32_t i = 0; i < priv->lightNum; ++i) {
137 struct LightDevice *priv = GetLightDevicePriv();
139 if (priv->lightNum > 0) {
140 *count = priv->lightNum;
141 *lightInfo = priv->lightInfoEntry;
145 (void)OsalMutexLock(&priv->mutex);
149 (void)OsalMutexUnlock(&priv->mutex);
157 (void)OsalMutexUnlock(&priv->mutex);
161 if (ReadLightInfo(reply, priv) != HDF_SUCCESS) {
163 (void)OsalMutexUnlock(&priv->mutex);
168 (void)OsalMutexUnlock(&priv->mutex);
170 *count = priv->lightNum;
171 *lightInfo = priv->lightInfoEntry;
212 struct LightDevice *priv = GetLightDevicePriv();
213 (void)OsalMutexLock(&priv->mutex);
218 (void)OsalMutexUnlock(&priv->mutex);
225 (void)OsalMutexUnlock(&priv->mutex);
232 (void)OsalMutexUnlock(&priv->mutex);
239 (void)OsalMutexUnlock(&priv->mutex);
248 (void)OsalMutexUnlock(&priv->mutex);
291 struct LightDevice *priv = GetLightDevicePriv();
292 (void)OsalMutexLock(&priv->mutex);
296 (void)OsalMutexUnlock(&priv->mutex);
331 (void)OsalMutexUnlock(&priv->mutex);
351 struct LightDevice *priv = GetLightDevicePriv();
352 (void)OsalMutexLock(&priv->mutex);
357 (void)OsalMutexUnlock(&priv->mutex);
364 (void)OsalMutexUnlock(&priv->mutex);
371 (void)OsalMutexUnlock(&priv->mutex);
380 (void)OsalMutexUnlock(&priv->mutex);
390 struct LightDevice *priv = GetLightDevicePriv();
392 if (priv->initState) {
396 OsalMutexInit(&priv->mutex);
402 priv->ioService = HdfIoServiceBind(LIGHT_SERVICE_NAME);
403 if (priv->ioService == NULL) {
405 OsalMutexDestroy(&priv->mutex);
409 priv->initState = true;
417 struct LightDevice *priv = GetLightDevicePriv();
419 if (!priv->initState) {
424 priv->lightNum = 0;
426 if (priv->ioService != NULL) {
427 HdfIoServiceRecycle(priv->ioService);
430 if (priv->lightInfoEntry != NULL) {
431 OsalMemFree(priv->lightInfoEntry);
432 priv->lightInfoEntry = NULL;
435 OsalMutexDestroy(&priv->mutex);