Skip to content

Commit c8d182b

Browse files
YongjiXiemstsirkin
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]>
1 parent 1057afa commit c8d182b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/linux/vdpa.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,17 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent,
277277
const struct vdpa_config_ops *config,
278278
size_t size, const char *name);
279279

280+
/**
281+
* vdpa_alloc_device - allocate and initilaize a vDPA device
282+
*
283+
* @dev_struct: the type of the parent structure
284+
* @member: the name of struct vdpa_device within the @dev_struct
285+
* @parent: the parent device
286+
* @config: the bus operations that is supported by this device
287+
* @name: name of the vdpa device
288+
*
289+
* Return allocated data structure or ERR_PTR upon error
290+
*/
280291
#define vdpa_alloc_device(dev_struct, member, parent, config, name) \
281292
container_of(__vdpa_alloc_device( \
282293
parent, config, \

0 commit comments

Comments
 (0)