mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! cdev: export cdevfs_add_partition for general use
Date: Thu,  4 Jan 2024 09:51:35 +0100	[thread overview]
Message-ID: <20240104085135.519786-1-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240103101629.2629497-4-a.fatoum@pengutronix.de>

Now that we export the function, some documentation can be useful.

Suggested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 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




  parent reply	other threads:[~2024-01-04  8:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 10:16 [PATCH 0/6] cdev: delete partitions when deleting master cdev Ahmad Fatoum
2024-01-03 10:16 ` [PATCH 1/6] cdev: make __devfs_add_partition's last argument optional Ahmad Fatoum
2024-01-03 10:16 ` [PATCH 2/6] driver.h: move devfs_add/del_partition later in file Ahmad Fatoum
2024-01-03 10:16 ` [PATCH 3/6] cdev: export cdevfs_add_partition for general use Ahmad Fatoum
2024-01-04  8:22   ` Sascha Hauer
2024-01-04  8:51   ` Ahmad Fatoum [this message]
2024-01-03 10:16 ` [PATCH 4/6] partition: switch to using cdevfs_add_partition Ahmad Fatoum
2024-01-03 10:16 ` [PATCH 5/6] cdev: export and use cdevfs_del_partition Ahmad Fatoum
2024-01-03 10:16 ` [PATCH 6/6] cdev: delete partitions when deleting master cdev Ahmad Fatoum
2024-01-08  9:59 ` [PATCH 0/6] " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240104085135.519786-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox