@@ -645,12 +645,12 @@ int w100fb_probe(struct platform_device *pdev)
/* Remap the chip base address */
remapped_base = ioremap_nocache(mem->start+W100_CFG_BASE, W100_CFG_LEN);
if (remapped_base == NULL)
- goto out;
+ goto exit;
/* Map the register space */
remapped_regs = ioremap_nocache(mem->start+W100_REG_BASE, W100_REG_LEN);
if (remapped_regs == NULL)
- goto out;
+ goto io_unmap_base;
/* Identify the chip */
printk("Found ");
@@ -662,19 +662,19 @@ int w100fb_probe(struct platform_device *pdev)
default:
printk("Unknown imageon chip ID\n");
err = -ENODEV;
- goto out;
+ goto io_unmap_regs;
}
printk(" at 0x%08lx.\n", (unsigned long) mem->start+W100_CFG_BASE);
/* Remap the framebuffer */
remapped_fbuf = ioremap_nocache(mem->start+MEM_WINDOW_BASE, MEM_WINDOW_SIZE);
if (remapped_fbuf == NULL)
- goto out;
+ goto io_unmap_regs;
info=framebuffer_alloc(sizeof(struct w100fb_par), &pdev->dev);
if (!info) {
err = -ENOMEM;
- goto out;
+ goto io_unmap_framebuffer;
}
par = info->par;
@@ -690,13 +690,13 @@ int w100fb_probe(struct platform_device *pdev)
if (!par->pll_table) {
printk(KERN_ERR "No matching Xtal definition found\n");
err = -EINVAL;
- goto out;
+ goto release_framebuffer;
}
info->pseudo_palette = kmalloc(sizeof (u32) * MAX_PALETTES, GFP_KERNEL);
if (!info->pseudo_palette) {
err = -ENOMEM;
- goto out;
+ goto release_framebuffer;
}
info->fbops = &w100fb_ops;
@@ -716,7 +716,7 @@ int w100fb_probe(struct platform_device *pdev)
if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
err = -ENOMEM;
- goto out;
+ goto free_palette;
}
par->mode = &inf->modelist[0];
@@ -766,15 +766,18 @@ int w100fb_probe(struct platform_device *pdev)
fb_info(info, "%s frame buffer device\n", info->fix.id);
return 0;
out:
- if (info) {
- fb_dealloc_cmap(&info->cmap);
- kfree(info->pseudo_palette);
- }
+ fb_dealloc_cmap(&info->cmap);
+free_palette:
+ kfree(info->pseudo_palette);
+release_framebuffer:
+ framebuffer_release(info);
+io_unmap_framebuffer:
iounmap(remapped_fbuf);
+io_unmap_regs:
iounmap(remapped_regs);
+io_unmap_base:
iounmap(remapped_base);
- if (info)
- framebuffer_release(info);
+exit:
return err;
}