mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-08-26 18:17:07 -04:00
Regular → Executable
+5
-6
@@ -38,7 +38,7 @@ static void PlatformDeviceOnLastPut(struct HdfSRef *sref)
|
||||
device->ready = false;
|
||||
|
||||
DLIST_FOR_EACH_ENTRY_SAFE(pos, tmp, &device->notifiers, struct PlatformNotifierNode, node) {
|
||||
if (pos!=NULL && pos->notifier != NULL && pos->notifier->handle != NULL) {
|
||||
if (pos->notifier != NULL && pos->notifier->handle != NULL) {
|
||||
pos->notifier->handle(device, PLAT_EVENT_DEAD, pos->notifier->data);
|
||||
}
|
||||
}
|
||||
@@ -155,13 +155,12 @@ static void PlatformDeviceRemoveNotifier(struct PlatformDevice *device, struct P
|
||||
DLIST_FOR_EACH_ENTRY_SAFE(pos, tmp, &device->notifiers, struct PlatformNotifierNode, node) {
|
||||
if (pos->notifier != NULL) {
|
||||
/* if notifier not set, we remove all the notifier nodes. */
|
||||
if (notifier == NULL || notifier == pos->notifier) {
|
||||
DListRemove(&pos->node);
|
||||
OsalMemFree(pos);
|
||||
}
|
||||
if (notifier == pos->notifier) {
|
||||
DListRemove(&pos->node);
|
||||
OsalMemFree(pos);
|
||||
break;
|
||||
}else if (notifier == NULL) {
|
||||
DListRemove(&pos->node);
|
||||
OsalMemFree(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ int32_t PlatformManagerAddDevice(struct PlatformManager *manager, struct Platfor
|
||||
|
||||
(void)OsalSpinLock(&manager->spin);
|
||||
DLIST_FOR_EACH_ENTRY(tmp, &manager->devices, struct PlatformDevice, node) {
|
||||
if (tmp!=NULL && tmp->magic == device->magic) {
|
||||
if (tmp != NULL && tmp->magic == device->magic) {
|
||||
repeatId = true;
|
||||
HDF_LOGE("PlatformManagerAddDevice: repeated magic:%u!", device->magic);
|
||||
break;
|
||||
@@ -130,7 +130,7 @@ struct PlatformDevice *PlatformManagerFindDevice(struct PlatformManager *manager
|
||||
|
||||
(void)OsalSpinLock(&manager->spin);
|
||||
DLIST_FOR_EACH_ENTRY(tmp, &manager->devices, struct PlatformDevice, node) {
|
||||
if (tmp!=NULL && match(tmp, data)) {
|
||||
if (tmp != NULL && match(tmp, data)) {
|
||||
pdevice = PlatformDeviceGet(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user