diff options
Diffstat (limited to 'drivers/video/ep93xx-fb.c')
-rw-r--r-- | drivers/video/ep93xx-fb.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c index f2c092da84b0..755ef3e65caf 100644 --- a/drivers/video/ep93xx-fb.c +++ b/drivers/video/ep93xx-fb.c | |||
@@ -529,7 +529,8 @@ static int __devinit ep93xxfb_probe(struct platform_device *pdev) | |||
529 | * any of the framebuffer registers. | 529 | * any of the framebuffer registers. |
530 | */ | 530 | */ |
531 | fbi->res = res; | 531 | fbi->res = res; |
532 | fbi->mmio_base = ioremap(res->start, resource_size(res)); | 532 | fbi->mmio_base = devm_ioremap(&pdev->dev, res->start, |
533 | resource_size(res)); | ||
533 | if (!fbi->mmio_base) { | 534 | if (!fbi->mmio_base) { |
534 | err = -ENXIO; | 535 | err = -ENXIO; |
535 | goto failed_resource; | 536 | goto failed_resource; |
@@ -553,20 +554,20 @@ static int __devinit ep93xxfb_probe(struct platform_device *pdev) | |||
553 | if (err == 0) { | 554 | if (err == 0) { |
554 | dev_err(info->dev, "No suitable video mode found\n"); | 555 | dev_err(info->dev, "No suitable video mode found\n"); |
555 | err = -EINVAL; | 556 | err = -EINVAL; |
556 | goto failed_mode; | 557 | goto failed_resource; |
557 | } | 558 | } |
558 | 559 | ||
559 | if (mach_info->setup) { | 560 | if (mach_info->setup) { |
560 | err = mach_info->setup(pdev); | 561 | err = mach_info->setup(pdev); |
561 | if (err) | 562 | if (err) |
562 | goto failed_mode; | 563 | goto failed_resource; |
563 | } | 564 | } |
564 | 565 | ||
565 | err = ep93xxfb_check_var(&info->var, info); | 566 | err = ep93xxfb_check_var(&info->var, info); |
566 | if (err) | 567 | if (err) |
567 | goto failed_check; | 568 | goto failed_check; |
568 | 569 | ||
569 | fbi->clk = clk_get(info->dev, NULL); | 570 | fbi->clk = devm_clk_get(&pdev->dev, NULL); |
570 | if (IS_ERR(fbi->clk)) { | 571 | if (IS_ERR(fbi->clk)) { |
571 | err = PTR_ERR(fbi->clk); | 572 | err = PTR_ERR(fbi->clk); |
572 | fbi->clk = NULL; | 573 | fbi->clk = NULL; |
@@ -578,19 +579,15 @@ static int __devinit ep93xxfb_probe(struct platform_device *pdev) | |||
578 | 579 | ||
579 | err = register_framebuffer(info); | 580 | err = register_framebuffer(info); |
580 | if (err) | 581 | if (err) |
581 | goto failed; | 582 | goto failed_check; |
582 | 583 | ||
583 | dev_info(info->dev, "registered. Mode = %dx%d-%d\n", | 584 | dev_info(info->dev, "registered. Mode = %dx%d-%d\n", |
584 | info->var.xres, info->var.yres, info->var.bits_per_pixel); | 585 | info->var.xres, info->var.yres, info->var.bits_per_pixel); |
585 | return 0; | 586 | return 0; |
586 | 587 | ||
587 | failed: | ||
588 | clk_put(fbi->clk); | ||
589 | failed_check: | 588 | failed_check: |
590 | if (fbi->mach_info->teardown) | 589 | if (fbi->mach_info->teardown) |
591 | fbi->mach_info->teardown(pdev); | 590 | fbi->mach_info->teardown(pdev); |
592 | failed_mode: | ||
593 | iounmap(fbi->mmio_base); | ||
594 | failed_resource: | 591 | failed_resource: |
595 | ep93xxfb_dealloc_videomem(info); | 592 | ep93xxfb_dealloc_videomem(info); |
596 | failed_videomem: | 593 | failed_videomem: |
@@ -609,8 +606,6 @@ static int __devexit ep93xxfb_remove(struct platform_device *pdev) | |||
609 | 606 | ||
610 | unregister_framebuffer(info); | 607 | unregister_framebuffer(info); |
611 | clk_disable(fbi->clk); | 608 | clk_disable(fbi->clk); |
612 | clk_put(fbi->clk); | ||
613 | iounmap(fbi->mmio_base); | ||
614 | ep93xxfb_dealloc_videomem(info); | 609 | ep93xxfb_dealloc_videomem(info); |
615 | fb_dealloc_cmap(&info->cmap); | 610 | fb_dealloc_cmap(&info->cmap); |
616 | 611 | ||