All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CORE: adding mtd_get_partition_physaddr()
@ 2006-08-29  4:44 Jared Hulbert
  2006-08-29 17:13 ` Josh Boyer
  0 siblings, 1 reply; 4+ messages in thread
From: Jared Hulbert @ 2006-08-29  4:44 UTC (permalink / raw)
  To: linux-mtd

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)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] CORE: adding mtd_get_partition_physaddr()
  2006-08-29  4:44 [PATCH] CORE: adding mtd_get_partition_physaddr() Jared Hulbert
@ 2006-08-29 17:13 ` Josh Boyer
  2006-08-29 19:37   ` Jared Hulbert
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Boyer @ 2006-08-29 17:13 UTC (permalink / raw)
  To: Jared Hulbert; +Cc: linux-mtd

On Mon, 2006-08-28 at 21:44 -0700, Jared Hulbert wrote:
> 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)

Nit: No space between the paren and the function name please.

>  /*
>   * 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);

Couldn't this be a proper prototype instead of an extern?

josh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] CORE: adding mtd_get_partition_physaddr()
  2006-08-29 17:13 ` Josh Boyer
@ 2006-08-29 19:37   ` Jared Hulbert
  2006-08-30 12:32     ` Sergei Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: Jared Hulbert @ 2006-08-29 19:37 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linux-mtd

> > +void * mtd_get_partition_physaddr (struct mtd_info *mtd)
>
> Nit: No space between the paren and the function name please.

oops

> > +extern void * mtd_get_partition_physaddr(struct mtd_info *mtd);
>
> Couldn't this be a proper prototype instead of an extern?

I thought EXPORT_SYMBOL_GPL()  implied it should be extern.  Is that incorrect?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] CORE: adding mtd_get_partition_physaddr()
  2006-08-29 19:37   ` Jared Hulbert
@ 2006-08-30 12:32     ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2006-08-30 12:32 UTC (permalink / raw)
  To: Jared Hulbert; +Cc: linux-mtd

Hello.

Jared Hulbert wrote:

>>>+extern void * mtd_get_partition_physaddr(struct mtd_info *mtd);

>>Couldn't this be a proper prototype instead of an extern?

> I thought EXPORT_SYMBOL_GPL()  implied it should be extern.  Is that incorrect?

    Function declarations in C imply 'extern' by default.

WBR, Sergei

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-30 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-29  4:44 [PATCH] CORE: adding mtd_get_partition_physaddr() Jared Hulbert
2006-08-29 17:13 ` Josh Boyer
2006-08-29 19:37   ` Jared Hulbert
2006-08-30 12:32     ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.