aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/gbefb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/gbefb.c')
-rw-r--r--drivers/video/gbefb.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 05e2a8a99d8f..3dad31975db8 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -20,6 +20,7 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/io.h>
23 24
24#ifdef CONFIG_X86 25#ifdef CONFIG_X86
25#include <asm/mtrr.h> 26#include <asm/mtrr.h>
@@ -28,7 +29,6 @@
28#include <asm/addrspace.h> 29#include <asm/addrspace.h>
29#endif 30#endif
30#include <asm/byteorder.h> 31#include <asm/byteorder.h>
31#include <asm/io.h>
32#include <asm/tlbflush.h> 32#include <asm/tlbflush.h>
33 33
34#include <video/gbe.h> 34#include <video/gbe.h>
@@ -1156,7 +1156,8 @@ static int __devinit gbefb_probe(struct platform_device *p_dev)
1156 goto out_release_framebuffer; 1156 goto out_release_framebuffer;
1157 } 1157 }
1158 1158
1159 gbe = (struct sgi_gbe *) ioremap(GBE_BASE, sizeof(struct sgi_gbe)); 1159 gbe = (struct sgi_gbe *) devm_ioremap(&p_dev->dev, GBE_BASE,
1160 sizeof(struct sgi_gbe));
1160 if (!gbe) { 1161 if (!gbe) {
1161 printk(KERN_ERR "gbefb: couldn't map mmio region\n"); 1162 printk(KERN_ERR "gbefb: couldn't map mmio region\n");
1162 ret = -ENXIO; 1163 ret = -ENXIO;
@@ -1170,12 +1171,13 @@ static int __devinit gbefb_probe(struct platform_device *p_dev)
1170 if (!gbe_tiles.cpu) { 1171 if (!gbe_tiles.cpu) {
1171 printk(KERN_ERR "gbefb: couldn't allocate tiles table\n"); 1172 printk(KERN_ERR "gbefb: couldn't allocate tiles table\n");
1172 ret = -ENOMEM; 1173 ret = -ENOMEM;
1173 goto out_unmap; 1174 goto out_release_mem_region;
1174 } 1175 }
1175 1176
1176 if (gbe_mem_phys) { 1177 if (gbe_mem_phys) {
1177 /* memory was allocated at boot time */ 1178 /* memory was allocated at boot time */
1178 gbe_mem = ioremap_nocache(gbe_mem_phys, gbe_mem_size); 1179 gbe_mem = devm_ioremap_nocache(&p_dev->dev, gbe_mem_phys,
1180 gbe_mem_size);
1179 if (!gbe_mem) { 1181 if (!gbe_mem) {
1180 printk(KERN_ERR "gbefb: couldn't map framebuffer\n"); 1182 printk(KERN_ERR "gbefb: couldn't map framebuffer\n");
1181 ret = -ENOMEM; 1183 ret = -ENOMEM;
@@ -1241,13 +1243,9 @@ static int __devinit gbefb_probe(struct platform_device *p_dev)
1241out_gbe_unmap: 1243out_gbe_unmap:
1242 if (gbe_dma_addr) 1244 if (gbe_dma_addr)
1243 dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys); 1245 dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
1244 else
1245 iounmap(gbe_mem);
1246out_tiles_free: 1246out_tiles_free:
1247 dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t), 1247 dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t),
1248 (void *)gbe_tiles.cpu, gbe_tiles.dma); 1248 (void *)gbe_tiles.cpu, gbe_tiles.dma);
1249out_unmap:
1250 iounmap(gbe);
1251out_release_mem_region: 1249out_release_mem_region:
1252 release_mem_region(GBE_BASE, sizeof(struct sgi_gbe)); 1250 release_mem_region(GBE_BASE, sizeof(struct sgi_gbe));
1253out_release_framebuffer: 1251out_release_framebuffer:
@@ -1264,12 +1262,9 @@ static int __devexit gbefb_remove(struct platform_device* p_dev)
1264 gbe_turn_off(); 1262 gbe_turn_off();
1265 if (gbe_dma_addr) 1263 if (gbe_dma_addr)
1266 dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys); 1264 dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
1267 else
1268 iounmap(gbe_mem);
1269 dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t), 1265 dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t),
1270 (void *)gbe_tiles.cpu, gbe_tiles.dma); 1266 (void *)gbe_tiles.cpu, gbe_tiles.dma);
1271 release_mem_region(GBE_BASE, sizeof(struct sgi_gbe)); 1267 release_mem_region(GBE_BASE, sizeof(struct sgi_gbe));
1272 iounmap(gbe);
1273 gbefb_remove_sysfs(&p_dev->dev); 1268 gbefb_remove_sysfs(&p_dev->dev);
1274 framebuffer_release(info); 1269 framebuffer_release(info);
1275 1270