From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
Arnd Bergmann <arnd.bergmann@de.ibm.com>,
Christian Krafft <krafft@de.ibm.com>
Subject: Re: [PATCH 07/10] add of_iomap function
Date: Tue, 24 Apr 2007 11:35:33 +1000 [thread overview]
Message-ID: <1177378533.14873.48.camel@localhost.localdomain> (raw)
In-Reply-To: <20070423193913.119032752@arndb.de>
On Mon, 2007-04-23 at 21:35 +0200, Arnd Bergmann wrote:
> plain text document attachment (powerpc-add-of_remap.diff)
> From: Christian Krafft <krafft@de.ibm.com>
>
> The of_iomap function maps memory for a given
> device_node and returns a pointer to that memory.
> This is used at some places, so it makes sense to
> a seperate function.
No point in inlining it imho.
Ben.
> Signed-off-by: Christian Krafft <krafft@de.ibm.com>
> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
>
> Index: linux-2.6/arch/powerpc/sysdev/pmi.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/sysdev/pmi.c
> +++ linux-2.6/arch/powerpc/sysdev/pmi.c
> @@ -33,7 +33,7 @@
> #include <asm/of_platform.h>
> #include <asm/io.h>
> #include <asm/pmi.h>
> -
> +#include <asm/prom.h>
>
> struct pmi_data {
> struct list_head handler;
> @@ -49,21 +49,6 @@ struct pmi_data {
> };
>
>
> -
> -static void __iomem *of_iomap(struct device_node *np)
> -{
> - struct resource res;
> -
> - if (of_address_to_resource(np, 0, &res))
> - return NULL;
> -
> - pr_debug("Resource start: 0x%lx\n", res.start);
> - pr_debug("Resource end: 0x%lx\n", res.end);
> -
> - return ioremap(res.start, 1 + res.end - res.start);
> -}
> -
> -
> static int pmi_irq_handler(int irq, void *dev_id)
> {
> struct pmi_data *data;
> @@ -154,7 +139,7 @@ static int pmi_of_probe(struct of_device
> goto out;
> }
>
> - data->pmi_reg = of_iomap(np);
> + data->pmi_reg = of_iomap(np, 0);
> if (!data->pmi_reg) {
> printk(KERN_ERR "pmi: invalid register address.\n");
> rc = -EFAULT;
> Index: linux-2.6/include/asm-powerpc/prom.h
> ===================================================================
> --- linux-2.6.orig/include/asm-powerpc/prom.h
> +++ linux-2.6/include/asm-powerpc/prom.h
> @@ -20,6 +20,7 @@
> #include <linux/platform_device.h>
> #include <asm/irq.h>
> #include <asm/atomic.h>
> +#include <asm/io.h>
>
> /* Definitions used by the flattened device tree */
> #define OF_DT_HEADER 0xd00dfeed /* marker */
> @@ -355,6 +356,16 @@ static inline int of_irq_to_resource(str
> return irq;
> }
>
> +static inline void __iomem *of_iomap(struct device_node *np, int index)
> +{
> + struct resource res;
> +
> + if (of_address_to_resource(np, index, &res))
> + return NULL;
> +
> + return ioremap(res.start, 1 + res.end - res.start);
> +}
> +
>
> #endif /* __KERNEL__ */
> #endif /* _POWERPC_PROM_H */
>
> --
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
next prev parent reply other threads:[~2007-04-24 1:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-23 19:35 [PATCH 00/10] non-spufs updates for cell platforms Arnd Bergmann
2007-04-23 19:35 ` [PATCH 01/10] cell: add cbe_node_to_cpu function Arnd Bergmann
2007-04-23 19:35 ` [PATCH 02/10] cbe_thermal: clean up computation of temperature Arnd Bergmann
2007-04-23 19:35 ` [PATCH 03/10] cbe_thermal: add throttling attributes to cpu and spu nodes Arnd Bergmann
2007-04-23 19:35 ` [PATCH 04/10] cell: use pmi in cpufreq driver Arnd Bergmann
2007-04-23 19:35 ` [PATCH 05/10] add check for initialized driver data to pmi driver Arnd Bergmann
2007-04-23 19:35 ` [PATCH 06/10] pmi probe device by device-type Arnd Bergmann
2007-04-23 19:35 ` [PATCH 07/10] add of_iomap function Arnd Bergmann
2007-04-24 1:35 ` Benjamin Herrenschmidt [this message]
2007-04-24 15:32 ` [PATCH] powerpc: uninline " Christian Krafft
2007-04-24 17:27 ` Arnd Bergmann
2007-04-24 22:35 ` Benjamin Herrenschmidt
2007-04-25 0:31 ` Paul Mackerras
2007-04-25 2:15 ` Paul Mackerras
2007-04-23 19:35 ` [PATCH 08/10] cell: add support for proper device-tree Arnd Bergmann
2007-04-23 23:16 ` Arnd Bergmann
2007-04-24 1:48 ` Benjamin Herrenschmidt
2007-04-23 19:35 ` [PATCH 09/10] cell: enable RTAS-based PTCAL for Cell XDR memory Arnd Bergmann
2007-04-23 19:35 ` [PATCH 10/10] update cell_defconfig Arnd Bergmann
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=1177378533.14873.48.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=arnd.bergmann@de.ibm.com \
--cc=arnd@arndb.de \
--cc=krafft@de.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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 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.