From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/5] devfs-core: introduce devfs_append_partition
Date: Tue, 18 Feb 2014 11:36:11 +0100 [thread overview]
Message-ID: <1392719775-16886-2-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1392719775-16886-1-git-send-email-u.kleine-koenig@pengutronix.de>
From: Jan Luebbe <jlu@pengutronix.de>
This simplifies board code for partition setup by keeping track of the
offset.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
[ukl: change return type analogous to how devfs_add_partition was
changed in 121c3d6e9c2f (devfs: let devfs_add_partition return the new
partition).]
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
fs/devfs-core.c | 9 +++++++++
include/driver.h | 6 ++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/fs/devfs-core.c b/fs/devfs-core.c
index 44f0169e6324..c10345b3bfed 100644
--- a/fs/devfs-core.c
+++ b/fs/devfs-core.c
@@ -303,6 +303,15 @@ struct cdev *devfs_add_partition(const char *devname, loff_t offset, loff_t size
return new;
}
+struct cdev *devfs_append_partition(const char *devname, loff_t *offset,
+ loff_t size, int flags, const char *name)
+{
+ struct cdev *ret;
+ ret = devfs_add_partition(devname, *offset, size, flags, name);
+ *offset += size;
+ return ret;
+}
+
int devfs_del_partition(const char *name)
{
struct cdev *cdev;
diff --git a/include/driver.h b/include/driver.h
index bbe789b51ead..9fa94ae78ab2 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -487,8 +487,10 @@ int cdev_erase(struct cdev *cdev, size_t count, loff_t offset);
#define DEVFS_IS_PARTITION (1 << 2)
#define DEVFS_IS_CHARACTER_DEV (1 << 3)
-struct cdev *devfs_add_partition(const char *devname, loff_t offset, loff_t size,
- int flags, const char *name);
+struct cdev *devfs_add_partition(const char *devname, loff_t offset,
+ loff_t size, int flags, const char *name);
+struct cdev *devfs_append_partition(const char *devname, loff_t *offset,
+ loff_t size, int flags, const char *name);
int devfs_del_partition(const char *name);
#define DRV_OF_COMPAT(compat) \
--
1.8.5.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-02-18 10:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 10:36 [PATCH 0/5] Introduce devfs_append_partition and a few users Uwe Kleine-König
2014-02-18 10:36 ` Uwe Kleine-König [this message]
2014-02-18 10:36 ` [PATCH 2/5] ARM: sama5d3xek: convert to devfs_append_partition Uwe Kleine-König
2014-02-18 10:43 ` Jean-Christophe PLAGNIOL-VILLARD
2014-02-18 10:36 ` [PATCH 3/5] ARM: a9m2410: " Uwe Kleine-König
2014-02-18 10:36 ` [PATCH 4/5] ARM: freescale-mx35-3-stack: " Uwe Kleine-König
2014-02-18 10:36 ` [PATCH 5/5] ARM: pca100: " Uwe Kleine-König
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=1392719775-16886-2-git-send-email-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@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