static void delete_device( struct device *device ) { struct device_file *file, *next; if (!device->manager) return; /* already deleted */ LIST_FOR_EACH_ENTRY_SAFE( file, next, &device->files, struct device_file, entry ) delete_file( file ); unlink_named_object( &device->obj ); list_remove( &device->entry ); device->manager = NULL; }
static void delete_device( struct device *device ) { struct ioctl_call *ioctl, *next; if (!device->manager) return; /* already deleted */ /* terminate all pending requests */ LIST_FOR_EACH_ENTRY_SAFE( ioctl, next, &device->requests, struct ioctl_call, dev_entry ) { list_remove( &ioctl->mgr_entry ); set_ioctl_result( ioctl, STATUS_FILE_DELETED, NULL, 0 ); } unlink_named_object( &device->obj ); list_remove( &device->entry ); device->manager = NULL; }