@@ -773,14 +773,14 @@ static int pvr2fb_common_init(void)
if (!fb_info->screen_base) {
printk(KERN_ERR "pvr2fb: Failed to remap smem space\n");
- goto out_err;
+ return -ENXIO;
}
par->mmio_base = (unsigned long)ioremap_nocache(pvr2_fix.mmio_start,
pvr2_fix.mmio_len);
if (!par->mmio_base) {
printk(KERN_ERR "pvr2fb: Failed to remap mmio space\n");
- goto out_err;
+ goto io_unmap_screen;
}
fb_memset(fb_info->screen_base, 0, pvr2_fix.smem_len);
@@ -807,7 +807,7 @@ static int pvr2fb_common_init(void)
fb_alloc_cmap(&fb_info->cmap, 256, 0);
if (register_framebuffer(fb_info) < 0)
- goto out_err;
+ goto io_unmap_mmio;
/*Must write PIXDEPTH to register before anything is displayed - so force init */
pvr2_init_display(fb_info);
@@ -840,10 +840,10 @@ static int pvr2fb_common_init(void)
return 0;
-out_err:
+io_unmap_mmio:
+ iounmap((void *)par->mmio_base);
+io_unmap_screen:
iounmap(fb_info->screen_base);
- if (par->mmio_base)
- iounmap((void *)par->mmio_base);
return -ENXIO;
}