diff options
author | Xie Yongji <xieyongji@bytedance.com> | 2021-07-15 11:00:26 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-08-11 13:44:23 +0300 |
commit | c8d182bd387a09a8b95303c8086238e8bf61fcfc (patch) | |
tree | 72d7850c0a57529db989fd03a98b1fb108c64c83 /include/linux | |
parent | 1057afa0121db8bd3ca4718c8e0ca12388ab7759 (diff) | |
download | linux-c8d182bd387a09a8b95303c8086238e8bf61fcfc.tar.xz |
vdpa: Add documentation for vdpa_alloc_device() macro
The return value of vdpa_alloc_device() macro is not very
clear, so that most of callers did the wrong check. Let's
add some comments to better document it.
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Link: https://lore.kernel.org/r/20210715080026.242-4-xieyongji@bytedance.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/vdpa.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 3357ac98878d..8cfe49d201dd 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -277,6 +277,17 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, const struct vdpa_config_ops *config, size_t size, const char *name); +/** + * vdpa_alloc_device - allocate and initilaize a vDPA device + * + * @dev_struct: the type of the parent structure + * @member: the name of struct vdpa_device within the @dev_struct + * @parent: the parent device + * @config: the bus operations that is supported by this device + * @name: name of the vdpa device + * + * Return allocated data structure or ERR_PTR upon error + */ #define vdpa_alloc_device(dev_struct, member, parent, config, name) \ container_of(__vdpa_alloc_device( \ parent, config, \ |