X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fvideo%2Fffb.c;h=15854aec31804e6c2633e2f4dedaf640d1539bf1;hb=15c945c3d0913d73a7d57d7a0a3c4e2902598cc6;hp=2a0e8210d398e6c964aa69028161cd3af471a44d;hpb=b20e481ab595e9667c33e2393bdfe9a31870d11f;p=linux-2.6-omap-h63xx.git diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 2a0e8210d39..15854aec318 100644 --- a/drivers/video/ffb.c +++ b/drivers/video/ffb.c @@ -910,7 +910,8 @@ static int ffb_init_one(struct of_device *op) all->par.dac = of_ioremap(&op->resource[1], 0, sizeof(struct ffb_dac), "ffb dac"); if (!all->par.dac) { - of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(&op->resource[2], + all->par.fbc, sizeof(struct ffb_fbc)); kfree(all); return -ENOMEM; } @@ -968,6 +969,10 @@ static int ffb_init_one(struct of_device *op) if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { printk(KERN_ERR "ffb: Could not allocate color map.\n"); + of_iounmap(&op->resource[2], + all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(&op->resource[1], + all->par.dac, sizeof(struct ffb_dac)); kfree(all); return -ENOMEM; } @@ -978,6 +983,10 @@ static int ffb_init_one(struct of_device *op) if (err < 0) { printk(KERN_ERR "ffb: Could not register framebuffer.\n"); fb_dealloc_cmap(&all->info.cmap); + of_iounmap(&op->resource[2], + all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(&op->resource[1], + all->par.dac, sizeof(struct ffb_dac)); kfree(all); return err; } @@ -999,19 +1008,19 @@ static int __devinit ffb_probe(struct of_device *dev, const struct of_device_id return ffb_init_one(op); } -static int __devexit ffb_remove(struct of_device *dev) +static int __devexit ffb_remove(struct of_device *op) { - struct all_info *all = dev_get_drvdata(&dev->dev); + struct all_info *all = dev_get_drvdata(&op->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); - of_iounmap(all->par.dac, sizeof(struct ffb_dac)); + of_iounmap(&op->resource[2], all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(&op->resource[1], all->par.dac, sizeof(struct ffb_dac)); kfree(all); - dev_set_drvdata(&dev->dev, NULL); + dev_set_drvdata(&op->dev, NULL); return 0; }