linux-mips
[Top] [All Lists]

Re: [PATCH V2 1/6] MIPS: lantiq: reorganize xway code

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH V2 1/6] MIPS: lantiq: reorganize xway code
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 17 Nov 2011 16:28:44 +0000
Cc: linux-mips@linux-mips.org
In-reply-to: <1321453698-2598-1-git-send-email-blogic@openwrt.org>
References: <1321453698-2598-1-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Nov 16, 2011 at 03:28:13PM +0100, John Crispin wrote:

> -     if (insert_resource(&iomem_resource, &ltq_cgu_resource) < 0)
> -             panic("Failed to insert cgu memory\n");

panic strings should not end in \n.

> +void __iomem *ltq_remap_resource(struct resource *res)
>  {
> -     struct clk *clk;
> +     __iomem void *ret = NULL;

void __iomem *ret = NULL;

diff --git a/arch/mips/lantiq/devices.h b/arch/mips/lantiq/devices.h
index 2947bb1..a03c23f 100644
--- a/arch/mips/lantiq/devices.h
+++ b/arch/mips/lantiq/devices.h
@@ -14,6 +14,10 @@

 #define IRQ_RES(resname, irq) \
        {.name = #resname, .start = (irq), .flags = IORESOURCE_IRQ}
+#define MEM_RES(resname, adr_start, adr_size) \
+       { .name = resname, .flags = IORESOURCE_MEM, \
+         .start = ((adr_start) & ~KSEG1), \
+         .end = ((adr_start + adr_size - 1) & ~KSEG1) }

Generally you're much better off by using physical addresses
as the kernel internal currency.  Don't make assumptions on the
value of the KSEG constants or that its value can be used or
turned into a bitmask.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>