On Wed, Nov 16, 2011 at 03:28:13PM +0100, John Crispin wrote: > - if (insert_resource(&iomem_resource, <q_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