提交 ef8397cf 编写于 作者: G Gertjan van Wingerde 提交者: John W. Linville

rt2x00: Use ioremap for SoC devices instead of KSEG1ADDR.

Make the code a bit more portable to architectures that do not support
KSEG1ADDR.
Signed-off-by: NGertjan van Wingerde <gwingerde@gmail.com>
Tested-by: NHelmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 72c7296e
...@@ -87,9 +87,11 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token) ...@@ -87,9 +87,11 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X) #if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev) static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
{ {
u32 *base_addr = (u32 *) KSEG1ADDR(0x1F040000); /* XXX for RT3052 */ void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE); memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
iounmap(base_addr);
} }
#else #else
static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev) static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
......
...@@ -40,6 +40,8 @@ static void rt2x00soc_free_reg(struct rt2x00_dev *rt2x00dev) ...@@ -40,6 +40,8 @@ static void rt2x00soc_free_reg(struct rt2x00_dev *rt2x00dev)
kfree(rt2x00dev->eeprom); kfree(rt2x00dev->eeprom);
rt2x00dev->eeprom = NULL; rt2x00dev->eeprom = NULL;
iounmap(rt2x00dev->csr.base);
} }
static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev) static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev)
...@@ -51,9 +53,9 @@ static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev) ...@@ -51,9 +53,9 @@ static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev)
if (!res) if (!res)
return -ENODEV; return -ENODEV;
rt2x00dev->csr.base = (void __iomem *)KSEG1ADDR(res->start); rt2x00dev->csr.base = ioremap(res->start, resource_size(res));
if (!rt2x00dev->csr.base) if (!rt2x00dev->csr.base)
goto exit; return -ENOMEM;
rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL); rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL);
if (!rt2x00dev->eeprom) if (!rt2x00dev->eeprom)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册