treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / misc / vmw_vmci / vmci_resource.h
blob02ae18506ecc75cc0af330b018a7cf8bbc716a72
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * VMware VMCI Driver
5 * Copyright (C) 2012 VMware, Inc. All rights reserved.
6 */
8 #ifndef _VMCI_RESOURCE_H_
9 #define _VMCI_RESOURCE_H_
11 #include <linux/vmw_vmci_defs.h>
12 #include <linux/types.h>
14 #include "vmci_context.h"
17 enum vmci_resource_type {
18 VMCI_RESOURCE_TYPE_ANY,
19 VMCI_RESOURCE_TYPE_API,
20 VMCI_RESOURCE_TYPE_GROUP,
21 VMCI_RESOURCE_TYPE_DATAGRAM,
22 VMCI_RESOURCE_TYPE_DOORBELL,
23 VMCI_RESOURCE_TYPE_QPAIR_GUEST,
24 VMCI_RESOURCE_TYPE_QPAIR_HOST
27 struct vmci_resource {
28 struct vmci_handle handle;
29 enum vmci_resource_type type;
30 struct hlist_node node;
31 struct kref kref;
32 struct completion done;
36 int vmci_resource_add(struct vmci_resource *resource,
37 enum vmci_resource_type resource_type,
38 struct vmci_handle handle);
40 void vmci_resource_remove(struct vmci_resource *resource);
42 struct vmci_resource *
43 vmci_resource_by_handle(struct vmci_handle resource_handle,
44 enum vmci_resource_type resource_type);
46 struct vmci_resource *vmci_resource_get(struct vmci_resource *resource);
47 int vmci_resource_put(struct vmci_resource *resource);
49 struct vmci_handle vmci_resource_handle(struct vmci_resource *resource);
51 #endif /* _VMCI_RESOURCE_H_ */