diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-12-29 00:01:32 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-31 17:06:05 -0500 |
commit | e3a411a3dfc1d633504aa63efab32b7e00318454 (patch) | |
tree | 2ba6117448edd7056c8fa48cc6a696ae73a6c21a /drivers/video/bw2.c | |
parent | 6fc5bae797a6632bbccdd49a1b6a96121368a4b9 (diff) |
[SPARC64]: Fix of_iounmap() region release.
We need to pass in the resource otherwise we cannot
release the region properly. We must know whether it is
an I/O or MEM resource.
Spotted by Eric Brower.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/video/bw2.c')
-rw-r--r-- | drivers/video/bw2.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index c66e3d52cbf3..9bb6257d6918 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c | |||
@@ -320,7 +320,7 @@ static int __devinit bw2_init_one(struct of_device *op) | |||
320 | all->info.fbops = &bw2_ops; | 320 | all->info.fbops = &bw2_ops; |
321 | 321 | ||
322 | all->info.screen_base = | 322 | all->info.screen_base = |
323 | sbus_ioremap(&op->resource[0], 0, all->par.fbsize, "bw2 ram"); | 323 | of_ioremap(&op->resource[0], 0, all->par.fbsize, "bw2 ram"); |
324 | all->info.par = &all->par; | 324 | all->info.par = &all->par; |
325 | 325 | ||
326 | bw2_blank(0, &all->info); | 326 | bw2_blank(0, &all->info); |
@@ -329,8 +329,10 @@ static int __devinit bw2_init_one(struct of_device *op) | |||
329 | 329 | ||
330 | err= register_framebuffer(&all->info); | 330 | err= register_framebuffer(&all->info); |
331 | if (err < 0) { | 331 | if (err < 0) { |
332 | of_iounmap(all->par.regs, sizeof(struct bw2_regs)); | 332 | of_iounmap(&op->resource[0], |
333 | of_iounmap(all->info.screen_base, all->par.fbsize); | 333 | all->par.regs, sizeof(struct bw2_regs)); |
334 | of_iounmap(&op->resource[0], | ||
335 | all->info.screen_base, all->par.fbsize); | ||
334 | kfree(all); | 336 | kfree(all); |
335 | return err; | 337 | return err; |
336 | } | 338 | } |
@@ -351,18 +353,18 @@ static int __devinit bw2_probe(struct of_device *dev, const struct of_device_id | |||
351 | return bw2_init_one(op); | 353 | return bw2_init_one(op); |
352 | } | 354 | } |
353 | 355 | ||
354 | static int __devexit bw2_remove(struct of_device *dev) | 356 | static int __devexit bw2_remove(struct of_device *op) |
355 | { | 357 | { |
356 | struct all_info *all = dev_get_drvdata(&dev->dev); | 358 | struct all_info *all = dev_get_drvdata(&op->dev); |
357 | 359 | ||
358 | unregister_framebuffer(&all->info); | 360 | unregister_framebuffer(&all->info); |
359 | 361 | ||
360 | of_iounmap(all->par.regs, sizeof(struct bw2_regs)); | 362 | of_iounmap(&op->resource[0], all->par.regs, sizeof(struct bw2_regs)); |
361 | of_iounmap(all->info.screen_base, all->par.fbsize); | 363 | of_iounmap(&op->resource[0], all->info.screen_base, all->par.fbsize); |
362 | 364 | ||
363 | kfree(all); | 365 | kfree(all); |
364 | 366 | ||
365 | dev_set_drvdata(&dev->dev, NULL); | 367 | dev_set_drvdata(&op->dev, NULL); |
366 | 368 | ||
367 | return 0; | 369 | return 0; |
368 | } | 370 | } |