public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jared Hulbert" <jaredeh@gmail.com>
To: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: [PATCH] CORE: adding mtd_get_partition_physaddr()
Date: Mon, 28 Aug 2006 21:44:11 -0700	[thread overview]
Message-ID: <6934efce0608282144ge2250dbv1635377c005a9f74@mail.gmail.com> (raw)

This is to allow axfs to get the physical address on the flash of it's
partition.

Signed-off-by: Jared Hulbert <jaredeh@gmail.com>

diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 06a9303..37aed8a 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -40,6 +40,17 @@ struct mtd_part {
  */
 #define PART(x)  ((struct mtd_part *)(x))

+/*
+ * Allow other modules to get the physical address of a given partition
+ */
+void * mtd_get_partition_physaddr (struct mtd_info *mtd)
+{
+	struct mtd_part *part = PART(mtd);
+	struct map_info *map = part->master->priv;
+
+	return (void *)(map->phys + part->offset);
+}
+EXPORT_SYMBOL_GPL(mtd_get_partition_physaddr);

 /*
  * MTD methods which simply translate the effective address and pass through
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index da6b3d6..adf6207 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -68,6 +68,7 @@ extern int register_mtd_parser(struct mt
 extern int deregister_mtd_parser(struct mtd_part_parser *parser);
 extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
 				struct mtd_partition **pparts, unsigned long origin);
+extern void * mtd_get_partition_physaddr(struct mtd_info *mtd);

 #define put_partition_parser(p) do { module_put((p)->owner); } while(0)

             reply	other threads:[~2006-08-29  4:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29  4:44 Jared Hulbert [this message]
2006-08-29 17:13 ` [PATCH] CORE: adding mtd_get_partition_physaddr() Josh Boyer
2006-08-29 19:37   ` Jared Hulbert
2006-08-30 12:32     ` Sergei Shtylyov

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=6934efce0608282144ge2250dbv1635377c005a9f74@mail.gmail.com \
    --to=jaredeh@gmail.com \
    --cc=linux-mtd@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