@@ -3605,10 +3605,8 @@ err_release_io:
#ifdef __sparc__
kfree(par->mmap_map);
#else
- if (par->ati_regbase)
- iounmap(par->ati_regbase);
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(par->ati_regbase);
+ iounmap(info->screen_base);
#endif
err_release_mem:
if (par->aux_start)
@@ -3733,13 +3731,10 @@ static void atyfb_remove(struct fb_info *info)
}
#endif
#ifndef __sparc__
- if (par->ati_regbase)
- iounmap(par->ati_regbase);
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(par->ati_regbase);
+ iounmap(info->screen_base);
#ifdef __BIG_ENDIAN
- if (info->sprite.addr)
- iounmap(info->sprite.addr);
+ iounmap(info->sprite.addr);
#endif
#endif
#ifdef __sparc__
@@ -2164,8 +2164,7 @@ err_release_regions:
#endif
pci_release_regions(pdev);
err_release_fb:
- if (cinfo->laguna_mmio != NULL)
- iounmap(cinfo->laguna_mmio);
+ iounmap(cinfo->laguna_mmio);
framebuffer_release(info);
err_out:
return ret;
@@ -1068,10 +1068,8 @@ static void control_cleanup(void)
if (!p)
return;
- if (p->cmap_regs)
- iounmap(p->cmap_regs);
- if (p->control_regs)
- iounmap(p->control_regs);
+ iounmap(p->cmap_regs);
+ iounmap(p->control_regs);
if (p->frame_buffer) {
if (p->control_use_bank2)
p->frame_buffer -= 0x600000;
@@ -65,8 +65,7 @@ static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
static void efifb_destroy(struct fb_info *info)
{
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
if (request_mem_succeeded)
release_mem_region(info->apertures->ranges[0].base,
info->apertures->ranges[0].size);
@@ -552,8 +552,7 @@ static int hgafb_probe(struct platform_device *pdev)
if (! hga_card_detect()) {
printk(KERN_INFO "hgafb: HGA card not detected.\n");
- if (hga_vram)
- iounmap(hga_vram);
+ iounmap(hga_vram);
return -EINVAL;
}
@@ -355,8 +355,7 @@ static void hpfb_remove_one(struct dio_dev *d)
iounmap((void *)fb_regs);
release_mem_region(d->resource.start, resource_size(&d->resource));
fb_dealloc_cmap(&fb_info.cmap);
- if (fb_info.screen_base)
- iounmap(fb_info.screen_base);
+ iounmap(fb_info.screen_base);
}
static struct dio_device_id hpfb_dio_tbl[] = {
@@ -2105,10 +2105,8 @@ static void i810fb_release_resource(struct fb_info *info,
if (par->i810_gtt.i810_fb_memory)
agp_free_memory(gtt->i810_fb_memory);
- if (par->mmio_start_virtual)
- iounmap(par->mmio_start_virtual);
- if (par->aperture.virtual)
- iounmap(par->aperture.virtual);
+ iounmap(par->mmio_start_virtual);
+ iounmap(par->aperture.virtual);
kfree(par->edid);
if (par->res_flags & FRAMEBUFFER_REQ)
release_mem_region(par->aperture.physical,
@@ -541,16 +541,11 @@ static void __init macfb_setup(char *options)
static void __init iounmap_macfb(void)
{
- if (dafb_cmap_regs)
- iounmap(dafb_cmap_regs);
- if (v8_brazil_cmap_regs)
- iounmap(v8_brazil_cmap_regs);
- if (rbv_cmap_regs)
- iounmap(rbv_cmap_regs);
- if (civic_cmap_regs)
- iounmap(civic_cmap_regs);
- if (csc_cmap_regs)
- iounmap(csc_cmap_regs);
+ iounmap(dafb_cmap_regs);
+ iounmap(v8_brazil_cmap_regs);
+ iounmap(rbv_cmap_regs);
+ iounmap(civic_cmap_regs);
+ iounmap(csc_cmap_regs);
}
static int __init macfb_init(void)
@@ -281,8 +281,7 @@ static int offb_set_par(struct fb_info *info)
static void offb_destroy(struct fb_info *info)
{
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
framebuffer_release(info);
}
@@ -841,8 +841,7 @@ static int pvr2fb_common_init(void)
return 0;
out_err:
- if (fb_info->screen_base)
- iounmap(fb_info->screen_base);
+ iounmap(fb_info->screen_base);
if (par->mmio_base)
iounmap((void *)par->mmio_base);
@@ -750,8 +750,7 @@ s1d13xxxfb_remove(struct platform_device *pdev)
fb_dealloc_cmap(&info->cmap);
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
framebuffer_release(info);
}
@@ -1382,8 +1382,7 @@ err_find_mode:
#ifdef CONFIG_FB_S3_DDC
if (par->ddc_registered)
i2c_del_adapter(&par->ddc_adapter);
- if (par->mmio)
- iounmap(par->mmio);
+ iounmap(par->mmio);
#endif
pci_iounmap(dev, info->screen_base);
err_iomap:
@@ -1419,8 +1418,7 @@ static void s3_pci_remove(struct pci_dev *dev)
#ifdef CONFIG_FB_S3_DDC
if (par->ddc_registered)
i2c_del_adapter(&par->ddc_adapter);
- if (par->mmio)
- iounmap(par->mmio);
+ iounmap(par->mmio);
#endif
pci_iounmap(dev, info->screen_base);
@@ -1397,8 +1397,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
ecodec:
free_irq(irq, hdmi);
ereqirq:
- if (hdmi->htop1)
- iounmap(hdmi->htop1);
+ iounmap(hdmi->htop1);
emap_htop1:
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
@@ -1428,8 +1427,7 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(hdmi->hdmi_clk);
clk_put(hdmi->hdmi_clk);
- if (hdmi->htop1)
- iounmap(hdmi->htop1);
+ iounmap(hdmi->htop1);
iounmap(hdmi->base);
release_mem_region(res->start, resource_size(res));
@@ -2489,8 +2489,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
clk_put(priv->dot_clk);
}
- if (priv->base)
- iounmap(priv->base);
+ iounmap(priv->base);
if (priv->irq)
free_irq(priv->irq, priv);
@@ -72,8 +72,7 @@ static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static void simplefb_destroy(struct fb_info *info)
{
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
}
static struct fb_ops simplefb_ops = {
@@ -1374,8 +1374,7 @@ stifb_cleanup(void)
unregister_framebuffer(sti->info);
release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
release_mem_region(info->fix.smem_start, info->fix.smem_len);
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
}
@@ -1572,15 +1572,13 @@ out_err_iobase:
release_region(pci_resource_start(pdev, 2),
pci_resource_len(pdev, 2));
out_err_screenbase:
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
release_mem_region(info->fix.smem_start, pci_resource_len(pdev, 1));
out_err_regbase:
/*
* Cleanup after anything that was remapped/allocated.
*/
- if (default_par->regbase_virt)
- iounmap(default_par->regbase_virt);
+ iounmap(default_par->regbase_virt);
release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
out_err:
framebuffer_release(info);
@@ -1520,8 +1520,7 @@ static int tgafb_register(struct device *dev)
err2:
fb_dealloc_cmap(&info->cmap);
err1:
- if (mem_base)
- iounmap(mem_base);
+ iounmap(mem_base);
release_mem_region(bar0_start, bar0_len);
err0:
framebuffer_release(info);
@@ -1531,13 +1531,11 @@ static int trident_pci_probe(struct pci_dev *dev,
out_unmap2:
kfree(info->pixmap.addr);
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
disable_mmio(info->par);
out_unmap1:
- if (default_par->io_virt)
- iounmap(default_par->io_virt);
+ iounmap(default_par->io_virt);
release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
framebuffer_release(info);
return err;
@@ -400,12 +400,9 @@ int __init valkyriefb_init(void)
out_cmap_free:
fb_dealloc_cmap(&p->info.cmap);
out_free:
- if (p->frame_buffer)
- iounmap(p->frame_buffer);
- if (p->cmap_regs)
- iounmap(p->cmap_regs);
- if (p->valkyrie_regs)
- iounmap(p->valkyrie_regs);
+ iounmap(p->frame_buffer);
+ iounmap(p->cmap_regs);
+ iounmap(p->valkyrie_regs);
kfree(p);
return err;
}
@@ -176,8 +176,7 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
static void vesafb_destroy(struct fb_info *info)
{
fb_dealloc_cmap(&info->cmap);
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
}
@@ -492,8 +491,7 @@ static int vesafb_probe(struct platform_device *dev)
fb_info(info, "%s frame buffer device\n", info->fix.id);
return 0;
err:
- if (info->screen_base)
- iounmap(info->screen_base);
+ iounmap(info->screen_base);
framebuffer_release(info);
release_mem_region(vesafb_fix.smem_start, size_total);
return err;
@@ -770,12 +770,9 @@ out:
fb_dealloc_cmap(&info->cmap);
kfree(info->pseudo_palette);
}
- if (remapped_fbuf != NULL)
- iounmap(remapped_fbuf);
- if (remapped_regs != NULL)
- iounmap(remapped_regs);
- if (remapped_base != NULL)
- iounmap(remapped_base);
+ iounmap(remapped_fbuf);
+ iounmap(remapped_regs);
+ iounmap(remapped_base);
if (info)
framebuffer_release(info);
return err;