diff options
author | Damien Cassou <damien.cassou@lifl.fr> | 2012-08-03 11:40:10 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-08-23 09:13:27 -0400 |
commit | e07d232335ed2b65b50b51d1564b418801901d7c (patch) | |
tree | dbe409703ad484a62bf05aeb6cc482bb2e022133 | |
parent | 776213493fe96de7fa4b53755ebc3dcd570a8ab9 (diff) |
drivers/video/epson1355fb.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in the
probe function of a platform device and is only freed in the remove function.
Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r-- | drivers/video/epson1355fb.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c index 68b9b511ce80..246da1e2968c 100644 --- a/drivers/video/epson1355fb.c +++ b/drivers/video/epson1355fb.c | |||
@@ -592,12 +592,8 @@ static int epson1355fb_remove(struct platform_device *dev) | |||
592 | 592 | ||
593 | if (info) { | 593 | if (info) { |
594 | fb_dealloc_cmap(&info->cmap); | 594 | fb_dealloc_cmap(&info->cmap); |
595 | if (info->screen_base) | ||
596 | iounmap(info->screen_base); | ||
597 | framebuffer_release(info); | 595 | framebuffer_release(info); |
598 | } | 596 | } |
599 | release_mem_region(EPSON1355FB_FB_PHYS, EPSON1355FB_FB_LEN); | ||
600 | release_mem_region(EPSON1355FB_REGS_PHYS, EPSON1355FB_REGS_LEN); | ||
601 | return 0; | 597 | return 0; |
602 | } | 598 | } |
603 | 599 | ||
@@ -608,15 +604,18 @@ static int __devinit epson1355fb_probe(struct platform_device *dev) | |||
608 | u8 revision; | 604 | u8 revision; |
609 | int rc = 0; | 605 | int rc = 0; |
610 | 606 | ||
611 | if (!request_mem_region(EPSON1355FB_REGS_PHYS, EPSON1355FB_REGS_LEN, "S1D13505 registers")) { | 607 | if (!devm_request_mem_region(&dev->dev, EPSON1355FB_REGS_PHYS, |
608 | EPSON1355FB_REGS_LEN, | ||
609 | "S1D13505 registers")) { | ||
612 | printk(KERN_ERR "epson1355fb: unable to reserve " | 610 | printk(KERN_ERR "epson1355fb: unable to reserve " |
613 | "registers at 0x%0x\n", EPSON1355FB_REGS_PHYS); | 611 | "registers at 0x%0x\n", EPSON1355FB_REGS_PHYS); |
614 | rc = -EBUSY; | 612 | rc = -EBUSY; |
615 | goto bail; | 613 | goto bail; |
616 | } | 614 | } |
617 | 615 | ||
618 | if (!request_mem_region(EPSON1355FB_FB_PHYS, EPSON1355FB_FB_LEN, | 616 | if (!devm_request_mem_region(&dev->dev, EPSON1355FB_FB_PHYS, |
619 | "S1D13505 framebuffer")) { | 617 | EPSON1355FB_FB_LEN, |
618 | "S1D13505 framebuffer")) { | ||
620 | printk(KERN_ERR "epson1355fb: unable to reserve " | 619 | printk(KERN_ERR "epson1355fb: unable to reserve " |
621 | "framebuffer at 0x%0x\n", EPSON1355FB_FB_PHYS); | 620 | "framebuffer at 0x%0x\n", EPSON1355FB_FB_PHYS); |
622 | rc = -EBUSY; | 621 | rc = -EBUSY; |
@@ -638,7 +637,8 @@ static int __devinit epson1355fb_probe(struct platform_device *dev) | |||
638 | } | 637 | } |
639 | info->pseudo_palette = default_par->pseudo_palette; | 638 | info->pseudo_palette = default_par->pseudo_palette; |
640 | 639 | ||
641 | info->screen_base = ioremap(EPSON1355FB_FB_PHYS, EPSON1355FB_FB_LEN); | 640 | info->screen_base = devm_ioremap(&dev->dev, EPSON1355FB_FB_PHYS, |
641 | EPSON1355FB_FB_LEN); | ||
642 | if (!info->screen_base) { | 642 | if (!info->screen_base) { |
643 | printk(KERN_ERR "epson1355fb: unable to map framebuffer\n"); | 643 | printk(KERN_ERR "epson1355fb: unable to map framebuffer\n"); |
644 | rc = -ENOMEM; | 644 | rc = -ENOMEM; |