diff options
Diffstat (limited to 'drivers/video/mbx/mbxfb.c')
-rw-r--r-- | drivers/video/mbx/mbxfb.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c index 85e4f44bfa61..6563e50413c1 100644 --- a/drivers/video/mbx/mbxfb.c +++ b/drivers/video/mbx/mbxfb.c | |||
@@ -26,8 +26,7 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/uaccess.h> | 28 | #include <linux/uaccess.h> |
29 | 29 | #include <linux/io.h> | |
30 | #include <asm/io.h> | ||
31 | 30 | ||
32 | #include <video/mbxfb.h> | 31 | #include <video/mbxfb.h> |
33 | 32 | ||
@@ -939,8 +938,9 @@ static int __devinit mbxfb_probe(struct platform_device *dev) | |||
939 | } | 938 | } |
940 | mfbi->reg_phys_addr = mfbi->reg_res->start; | 939 | mfbi->reg_phys_addr = mfbi->reg_res->start; |
941 | 940 | ||
942 | mfbi->reg_virt_addr = ioremap_nocache(mfbi->reg_phys_addr, | 941 | mfbi->reg_virt_addr = devm_ioremap_nocache(&dev->dev, |
943 | res_size(mfbi->reg_req)); | 942 | mfbi->reg_phys_addr, |
943 | res_size(mfbi->reg_req)); | ||
944 | if (!mfbi->reg_virt_addr) { | 944 | if (!mfbi->reg_virt_addr) { |
945 | dev_err(&dev->dev, "failed to ioremap Marathon registers\n"); | 945 | dev_err(&dev->dev, "failed to ioremap Marathon registers\n"); |
946 | ret = -EINVAL; | 946 | ret = -EINVAL; |
@@ -948,12 +948,12 @@ static int __devinit mbxfb_probe(struct platform_device *dev) | |||
948 | } | 948 | } |
949 | virt_base_2700 = mfbi->reg_virt_addr; | 949 | virt_base_2700 = mfbi->reg_virt_addr; |
950 | 950 | ||
951 | mfbi->fb_virt_addr = ioremap_nocache(mfbi->fb_phys_addr, | 951 | mfbi->fb_virt_addr = devm_ioremap_nocache(&dev->dev, mfbi->fb_phys_addr, |
952 | res_size(mfbi->fb_req)); | 952 | res_size(mfbi->fb_req)); |
953 | if (!mfbi->fb_virt_addr) { | 953 | if (!mfbi->fb_virt_addr) { |
954 | dev_err(&dev->dev, "failed to ioremap frame buffer\n"); | 954 | dev_err(&dev->dev, "failed to ioremap frame buffer\n"); |
955 | ret = -EINVAL; | 955 | ret = -EINVAL; |
956 | goto err4; | 956 | goto err3; |
957 | } | 957 | } |
958 | 958 | ||
959 | fbi->screen_base = (char __iomem *)(mfbi->fb_virt_addr + 0x60000); | 959 | fbi->screen_base = (char __iomem *)(mfbi->fb_virt_addr + 0x60000); |
@@ -971,7 +971,7 @@ static int __devinit mbxfb_probe(struct platform_device *dev) | |||
971 | if (ret < 0) { | 971 | if (ret < 0) { |
972 | dev_err(&dev->dev, "fb_alloc_cmap failed\n"); | 972 | dev_err(&dev->dev, "fb_alloc_cmap failed\n"); |
973 | ret = -EINVAL; | 973 | ret = -EINVAL; |
974 | goto err5; | 974 | goto err3; |
975 | } | 975 | } |
976 | 976 | ||
977 | platform_set_drvdata(dev, fbi); | 977 | platform_set_drvdata(dev, fbi); |
@@ -996,10 +996,6 @@ static int __devinit mbxfb_probe(struct platform_device *dev) | |||
996 | 996 | ||
997 | err6: | 997 | err6: |
998 | fb_dealloc_cmap(&fbi->cmap); | 998 | fb_dealloc_cmap(&fbi->cmap); |
999 | err5: | ||
1000 | iounmap(mfbi->fb_virt_addr); | ||
1001 | err4: | ||
1002 | iounmap(mfbi->reg_virt_addr); | ||
1003 | err3: | 999 | err3: |
1004 | release_mem_region(mfbi->reg_res->start, res_size(mfbi->reg_res)); | 1000 | release_mem_region(mfbi->reg_res->start, res_size(mfbi->reg_res)); |
1005 | err2: | 1001 | err2: |
@@ -1026,10 +1022,7 @@ static int __devexit mbxfb_remove(struct platform_device *dev) | |||
1026 | if (mfbi->platform_remove) | 1022 | if (mfbi->platform_remove) |
1027 | mfbi->platform_remove(fbi); | 1023 | mfbi->platform_remove(fbi); |
1028 | 1024 | ||
1029 | if (mfbi->fb_virt_addr) | 1025 | |
1030 | iounmap(mfbi->fb_virt_addr); | ||
1031 | if (mfbi->reg_virt_addr) | ||
1032 | iounmap(mfbi->reg_virt_addr); | ||
1033 | if (mfbi->reg_req) | 1026 | if (mfbi->reg_req) |
1034 | release_mem_region(mfbi->reg_req->start, | 1027 | release_mem_region(mfbi->reg_req->start, |
1035 | res_size(mfbi->reg_req)); | 1028 | res_size(mfbi->reg_req)); |