Now that we export the function, some documentation can be useful. Suggested-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- fs/devfs-core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/devfs-core.c b/fs/devfs-core.c index 912bfeede8dc..060a24795c47 100644 --- a/fs/devfs-core.c +++ b/fs/devfs-core.c @@ -474,6 +474,17 @@ static struct cdev *check_overlap(struct cdev *cdev, const char *name, loff_t of return ret ? ERR_PTR(ret) : cpart; } +/** + * cdevfs_add_partition() - add partition to already registered cdev + * @cdev: parent cdev + * @partinfo: new partition information + * @end: If not NULL, will hold the the (non-inclusive) end offset of the newly + * created partition. + * + * Return: the newly registered cdev or an error pointer if the new partition + * would clash with exisiting partitions or overflow the cdev. + * A valid cdev can be freed with cdevfs_del_partition() + */ struct cdev *cdevfs_add_partition(struct cdev *cdev, const struct devfs_partition *partinfo, loff_t *end) { -- 2.39.2