All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
To: felipe.contreras@gmail.com
Cc: linux-omap@vger.kernel.org, h-kanigeri2@ti.com,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [PATCH] omap3-iommu: reorganize
Date: Tue, 19 May 2009 09:03:25 +0300 (EEST)	[thread overview]
Message-ID: <20090519.090325.02296387.Hiroshi.DOYU@nokia.com> (raw)
In-Reply-To: <1242664980-6324-1-git-send-email-felipe.contreras@gmail.com>

From: ext Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH] omap3-iommu: reorganize
Date: Mon, 18 May 2009 18:43:00 +0200

> No functional changes.
> 
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> 
> How about this?

What's the advantage of introducing a new structure here?

> 
>  arch/arm/mach-omap2/omap3-iommu.c |   53 ++++++++++++++++++-------------------
>  1 files changed, 26 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap3-iommu.c b/arch/arm/mach-omap2/omap3-iommu.c
> index 91ee38a..50bd445 100644
> --- a/arch/arm/mach-omap2/omap3-iommu.c
> +++ b/arch/arm/mach-omap2/omap3-iommu.c
> @@ -14,32 +14,30 @@
>  
>  #include <mach/iommu.h>
>  
> -#define OMAP3_MMU1_BASE	0x480bd400
> -#define OMAP3_MMU2_BASE	0x5d000000
> -#define OMAP3_MMU1_IRQ	24
> -#define OMAP3_MMU2_IRQ	28
> -
> -
> -static unsigned long iommu_base[] __initdata = {
> -	OMAP3_MMU1_BASE,
> -	OMAP3_MMU2_BASE,
> -};
> -
> -static int iommu_irq[] __initdata = {
> -	OMAP3_MMU1_IRQ,
> -	OMAP3_MMU2_IRQ,
> +struct iommu_device {
> +	resource_size_t base;
> +	int irq;
> +	struct iommu_platform_data pdata;
>  };
>  
> -static const struct iommu_platform_data omap3_iommu_pdata[] __initconst = {
> +static struct iommu_device devices[] __initdata = {
>  	{
> -		.name = "isp",
> -		.nr_tlb_entries = 8,
> -		.clk_name = "cam_ick",
> +		.base = 0x480bd400,
> +		.irq = 24,
> +		.pdata = {
> +			.name = "isp",
> +			.nr_tlb_entries = 8,
> +			.clk_name = "cam_ick",
> +		},
>  	},
>  	{
> -		.name = "iva2",
> -		.nr_tlb_entries = 32,
> -		.clk_name = "iva2_ck",
> +		.base = 0x5d000000,
> +		.irq = 28,
> +		.pdata = {
> +			.name = "iva2",
> +			.nr_tlb_entries = 32,
> +			.clk_name = "iva2_ck",
> +		},
>  	},
>  };
>  #define NR_IOMMU_DEVICES ARRAY_SIZE(omap3_iommu_pdata)
> @@ -52,6 +50,7 @@ static int __init omap3_iommu_init(void)
>  
>  	for (i = 0; i < NR_IOMMU_DEVICES; i++) {
>  		struct platform_device *pdev;
> +		const struct iommu_device *d = &devices[i];
>  		struct resource res[2];
>  
>  		pdev = platform_device_alloc("omap-iommu", i);
> @@ -60,19 +59,19 @@ static int __init omap3_iommu_init(void)
>  			goto err_out;
>  		}
>  
> -		memset(res, 0,  sizeof(res));
> -		res[0].start = iommu_base[i];
> -		res[0].end = iommu_base[i] + MMU_REG_SIZE - 1;
> +		memset(res, 0, sizeof(res));
> +		res[0].start = d->base;
> +		res[0].end = d->base + MMU_REG_SIZE - 1;
>  		res[0].flags = IORESOURCE_MEM;
> -		res[1].start = res[1].end = iommu_irq[i];
> +		res[1].start = res[1].end = d->irq;
>  		res[1].flags = IORESOURCE_IRQ;
>  
>  		err = platform_device_add_resources(pdev, res,
>  						    ARRAY_SIZE(res));
>  		if (err)
>  			goto err_out;
> -		err = platform_device_add_data(pdev, &omap3_iommu_pdata[i],
> -					       sizeof(omap3_iommu_pdata[0]));
> +		err = platform_device_add_data(pdev, &d->pdata,
> +					       sizeof(d->pdata));
>  		if (err)
>  			goto err_out;
>  		err = platform_device_add(pdev);
> -- 
> 1.6.3.1
> 

  reply	other threads:[~2009-05-19  6:04 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-05 12:46 [PATCH 0/6] Initial support for omap iommu driver Hiroshi DOYU
2009-05-05 12:46 ` [PATCH 1/6] omap iommu: tlb and pagetable primitives Hiroshi DOYU
2009-05-05 20:19   ` Kanigeri, Hari
2009-05-06  5:56     ` Hiroshi DOYU
2009-05-05 12:46 ` [PATCH 2/6] omap iommu: omap2 architecture specific functions Hiroshi DOYU
2009-05-06 14:31   ` Kanigeri, Hari
2009-05-07  5:12     ` Hiroshi DOYU
2009-05-07 14:40       ` Kanigeri, Hari
2009-05-05 12:47 ` [PATCH 3/6] omap iommu: omap3 iommu device registration Hiroshi DOYU
2009-05-05 19:32   ` Felipe Contreras
2009-05-06  6:00     ` Hiroshi DOYU
2009-05-07 20:02       ` Felipe Contreras
2009-05-07 20:11         ` [RFC/PATCH 0/3] omap3-iommu: cleanups and remote registration Felipe Contreras
2009-05-07 20:11           ` [RFC/PATCH 1/3] omap3-iommu: reorganize Felipe Contreras
2009-05-07 20:11             ` [RFC/PATCH 2/3] omap3-iommu: split init function into omap_iommu_add Felipe Contreras
2009-05-07 20:11               ` [RFC/PATCH 3/3] omap3-iommu: remote registration Felipe Contreras
2009-05-07 21:14             ` [RFC/PATCH 1/3] omap3-iommu: reorganize Felipe Balbi
2009-05-07 22:16               ` Felipe Contreras
2009-05-08  4:15               ` Hiroshi DOYU
2009-05-07 20:28           ` [RFC/PATCH 0/3] omap3-iommu: cleanups and remote registration Kanigeri, Hari
2009-05-07 20:39             ` Felipe Contreras
2009-05-07 20:54               ` Kanigeri, Hari
2009-05-08  4:14           ` Hiroshi DOYU
2009-05-08  8:04             ` Felipe Contreras
2009-05-07 20:05   ` [PATCH 3/6] omap iommu: omap3 iommu device registration Felipe Contreras
2009-05-08  4:10     ` Hiroshi DOYU
2009-05-08  7:32       ` Felipe Contreras
2009-05-08 17:21         ` Aguirre Rodriguez, Sergio Alberto
2009-05-08 22:27           ` Felipe Contreras
2009-05-16  9:20   ` Russell King - ARM Linux
2009-05-16  9:38     ` Felipe Contreras
2009-05-16  9:54       ` Russell King - ARM Linux
2009-05-16  9:56         ` Felipe Contreras
2009-05-16  9:55     ` Russell King - ARM Linux
2009-05-18  5:36       ` Hiroshi DOYU
2009-05-18  9:39       ` Hiroshi DOYU
2009-05-18 14:26       ` Hiroshi DOYU
2009-05-18 16:43         ` [PATCH] omap3-iommu: reorganize Felipe Contreras
2009-05-19  6:03           ` Hiroshi DOYU [this message]
2009-05-19  9:43             ` Felipe Contreras
2009-05-18  5:22     ` [PATCH 3/6] omap iommu: omap3 iommu device registration Hiroshi DOYU
2009-05-05 12:47 ` [PATCH 4/6] omap iommu: simple virtual address space management Hiroshi DOYU
2009-05-16  9:22   ` Russell King - ARM Linux
2009-05-18  6:31     ` Hiroshi DOYU
2009-05-18 13:10       ` Russell King - ARM Linux
2009-05-05 12:47 ` [PATCH 5/6] omap iommu: entries for Kconfig and Makefile Hiroshi DOYU
2009-05-18 13:36   ` Russell King - ARM Linux
2009-05-05 12:47 ` [PATCH 6/6] omap2 " Hiroshi DOYU
     [not found] <1252873141-20496-1-git-send-email-felipe.contreras@gmail.com>
2009-09-13 20:36 ` [PATCH] omap3-iommu: reorganize Felipe Contreras

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=20090519.090325.02296387.Hiroshi.DOYU@nokia.com \
    --to=hiroshi.doyu@nokia.com \
    --cc=felipe.contreras@gmail.com \
    --cc=h-kanigeri2@ti.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.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.