Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6112ea08 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven
Browse files

zorro: ZTWO_VADDR() should return "void __iomem *"



ZTWO_VADDR() converts from physical to virtual I/O addresses, so it should
return "void __iomem *" instead of "unsigned long".

This allows to drop several casts, but requires adding a few casts to
accomodate legacy driver frameworks that store "unsigned long" I/O
addresses.

Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 83b7bce3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ void *amiga_chip_alloc_res(unsigned long size, struct resource *res)

	atomic_sub(size, &chipavail);
	pr_debug("amiga_chip_alloc_res: returning %pR\n", res);
	return (void *)ZTWO_VADDR(res->start);
	return ZTWO_VADDR(res->start);
}

void amiga_chip_free(void *ptr)
+1 −1
Original line number Diff line number Diff line
@@ -618,7 +618,7 @@ static int __init amiga_savekmsg_setup(char *arg)

	/* Just steal the block, the chipram allocator isn't functional yet */
	amiga_chip_size -= SAVEKMSG_MAXMEM;
	savekmsg = (void *)ZTWO_VADDR(CHIP_PHYSADDR + amiga_chip_size);
	savekmsg = ZTWO_VADDR(CHIP_PHYSADDR + amiga_chip_size);
	savekmsg->magic1 = SAVEKMSG_MAGIC1;
	savekmsg->magic2 = SAVEKMSG_MAGIC2;
	savekmsg->magicptr = ZTWO_PADDR(savekmsg);
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ struct CIA {

#define zTwoBase (0x80000000)
#define ZTWO_PADDR(x) (((unsigned long)(x))-zTwoBase)
#define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase)
#define ZTWO_VADDR(x) ((void __iomem *)(((unsigned long)(x))+zTwoBase))

#define CUSTOM_PHYSADDR     (0xdff000)
#define amiga_custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR)))
+2 −2
Original line number Diff line number Diff line
@@ -116,8 +116,8 @@ get_z2ram( void )
	if ( test_bit( i, zorro_unused_z2ram ) )
	{
	    z2_count++;
	    z2ram_map[ z2ram_size++ ] = 
		ZTWO_VADDR( Z2RAM_START ) + ( i << Z2RAM_CHUNKSHIFT );
	    z2ram_map[z2ram_size++] = (unsigned long)ZTWO_VADDR(Z2RAM_START) +
				      (i << Z2RAM_CHUNKSHIFT);
	    clear_bit( i, zorro_unused_z2ram );
	}
    }
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ static int __init buddha_init(void)
				continue;
			}
		}	  
		buddha_board = ZTWO_VADDR(board);
		buddha_board = (unsigned long)ZTWO_VADDR(board);
		
		/* write to BUDDHA_IRQ_MR to enable the board IRQ */
		/* X-Surf doesn't have this.  IRQs are always on */
Loading