Lines Matching refs:priv
40 struct VibratorDevice *priv = GetVibratorDevicePriv();
42 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
43 CHECK_NULL_PTR_RETURN_VALUE(priv->ioService, HDF_FAILURE);
44 CHECK_NULL_PTR_RETURN_VALUE(priv->ioService->dispatcher, HDF_FAILURE);
45 CHECK_NULL_PTR_RETURN_VALUE(priv->ioService->dispatcher->Dispatch, HDF_FAILURE);
47 int32_t ret = priv->ioService->dispatcher->Dispatch(&priv->ioService->object, cmd, msg, reply);
56 static int32_t ReadVibratorInfo(struct HdfSBuf *reply, struct VibratorDevice *priv)
58 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
72 if (memcpy_s(&priv->vibratorInfoEntry, sizeof(priv->vibratorInfoEntry), buf, sizeof(*buf)) != EOK) {
87 struct VibratorDevice *priv = GetVibratorDevicePriv();
89 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
91 (void)OsalMutexLock(&priv->mutex);
95 (void)OsalMutexUnlock(&priv->mutex);
103 (void)OsalMutexUnlock(&priv->mutex);
107 if (ReadVibratorInfo(reply, priv) != HDF_SUCCESS) {
109 (void)OsalMutexUnlock(&priv->mutex);
114 (void)OsalMutexUnlock(&priv->mutex);
116 *vibratorInfo = &priv->vibratorInfoEntry;
123 struct VibratorDevice *priv = GetVibratorDevicePriv();
124 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
130 if ((priv->vibratorInfoEntry.isSupportIntensity == 0) || (intensity < priv->vibratorInfoEntry.intensityMinValue) ||
131 (intensity > priv->vibratorInfoEntry.intensityMaxValue)) {
136 if ((priv->vibratorInfoEntry.isSupportFrequency == 0) || (frequency < priv->vibratorInfoEntry.frequencyMinValue) ||
137 (frequency > priv->vibratorInfoEntry.frequencyMaxValue)) {
148 struct VibratorDevice *priv = GetVibratorDevicePriv();
156 (void)OsalMutexLock(&priv->mutex);
160 (void)OsalMutexUnlock(&priv->mutex);
167 (void)OsalMutexUnlock(&priv->mutex);
174 (void)OsalMutexUnlock(&priv->mutex);
181 (void)OsalMutexUnlock(&priv->mutex);
189 (void)OsalMutexUnlock(&priv->mutex);
197 struct VibratorDevice *priv = GetVibratorDevicePriv();
198 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
200 (void)OsalMutexLock(&priv->mutex);
204 (void)OsalMutexUnlock(&priv->mutex);
211 (void)OsalMutexUnlock(&priv->mutex);
220 (void)OsalMutexUnlock(&priv->mutex);
228 struct VibratorDevice *priv = GetVibratorDevicePriv();
229 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
236 (void)OsalMutexLock(&priv->mutex);
241 (void)OsalMutexUnlock(&priv->mutex);
248 (void)OsalMutexUnlock(&priv->mutex);
257 (void)OsalMutexUnlock(&priv->mutex);
283 struct VibratorDevice *priv = GetVibratorDevicePriv();
284 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
286 (void)OsalMutexLock(&priv->mutex);
290 (void)OsalMutexUnlock(&priv->mutex);
297 (void)OsalMutexUnlock(&priv->mutex);
306 (void)OsalMutexUnlock(&priv->mutex);
334 struct VibratorDevice *priv = GetVibratorDevicePriv();
336 if (priv == NULL) {
339 if (priv->initState) {
343 OsalMutexInit(&priv->mutex);
354 priv->ioService = HdfIoServiceBind(VIBRATOR_SERVICE_NAME);
355 if (priv->ioService == NULL) {
357 OsalMutexDestroy(&priv->mutex);
361 priv->initState = true;
368 struct VibratorDevice *priv = GetVibratorDevicePriv();
370 CHECK_NULL_PTR_RETURN_VALUE(priv, HDF_FAILURE);
372 if (!priv->initState) {
377 if (priv->ioService != NULL) {
378 HdfIoServiceRecycle(priv->ioService);
381 OsalMutexDestroy(&priv->mutex);