[rt2x00-users] [PATCH 1/2] rt2x00: Use ioremap for SoC devices instead of KSEG1ADDR.

Helmut Schaa helmut.schaa at googlemail.com
Mon Jul 19 06:17:32 AEST 2010


Am Samstag 17 Juli 2010 schrieb Gertjan van Wingerde:
> Make the code a bit more portable to architectures that do not support
> KSEG1ADDR.
> 
> Signed-off-by: Gertjan van Wingerde <gwingerde at gmail.com>
> ---
> 
> Note: Compile tested only, as I do not own a SOC device.

One more thing: I guess we'll need a corresponding call to iounmap as well,
somewhere in the uninit code ...

Helmut

> ---
>  drivers/net/wireless/rt2x00/rt2800pci.c |    2 +-
>  drivers/net/wireless/rt2x00/rt2x00soc.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> index 39b3846..76d902a 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -87,7 +87,7 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
>  #ifdef CONFIG_RT2800PCI_SOC
>  static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
>  {
> -	u32 *base_addr = (u32 *) KSEG1ADDR(0x1F040000); /* XXX for RT3052 */
> +	u32 *base_addr = (u32 *) ioremap(0x1F040000, EEPROM_SIZE);
>  
>  	memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
>  }
> diff --git a/drivers/net/wireless/rt2x00/rt2x00soc.c b/drivers/net/wireless/rt2x00/rt2x00soc.c
> index fc98063..705035b 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00soc.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00soc.c
> @@ -51,7 +51,7 @@ static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev)
>  	if (!res)
>  		return -ENODEV;
>  
> -	rt2x00dev->csr.base = (void __iomem *)KSEG1ADDR(res->start);
> +	rt2x00dev->csr.base = ioremap(res->start, resource_size(res));
>  	if (!rt2x00dev->csr.base)
>  		goto exit;
>  
> 





More information about the users mailing list