| .. | .. |
|---|
| 721 | 721 | xres, yres, xres_virtual, yres_virtual, is_color, is_dual, is_tft); |
|---|
| 722 | 722 | } |
|---|
| 723 | 723 | |
|---|
| 724 | | - |
|---|
| 725 | | -static int |
|---|
| 726 | | -s1d13xxxfb_remove(struct platform_device *pdev) |
|---|
| 724 | +static void __s1d13xxxfb_remove(struct platform_device *pdev) |
|---|
| 727 | 725 | { |
|---|
| 728 | 726 | struct fb_info *info = platform_get_drvdata(pdev); |
|---|
| 729 | 727 | struct s1d13xxxfb_par *par = NULL; |
|---|
| .. | .. |
|---|
| 746 | 744 | } |
|---|
| 747 | 745 | |
|---|
| 748 | 746 | release_mem_region(pdev->resource[0].start, |
|---|
| 749 | | - pdev->resource[0].end - pdev->resource[0].start +1); |
|---|
| 747 | + resource_size(&pdev->resource[0])); |
|---|
| 750 | 748 | release_mem_region(pdev->resource[1].start, |
|---|
| 751 | | - pdev->resource[1].end - pdev->resource[1].start +1); |
|---|
| 749 | + resource_size(&pdev->resource[1])); |
|---|
| 750 | +} |
|---|
| 751 | + |
|---|
| 752 | +static int s1d13xxxfb_remove(struct platform_device *pdev) |
|---|
| 753 | +{ |
|---|
| 754 | + struct fb_info *info = platform_get_drvdata(pdev); |
|---|
| 755 | + |
|---|
| 756 | + unregister_framebuffer(info); |
|---|
| 757 | + __s1d13xxxfb_remove(pdev); |
|---|
| 752 | 758 | return 0; |
|---|
| 753 | 759 | } |
|---|
| 754 | 760 | |
|---|
| .. | .. |
|---|
| 788 | 794 | } |
|---|
| 789 | 795 | |
|---|
| 790 | 796 | if (!request_mem_region(pdev->resource[0].start, |
|---|
| 791 | | - pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) { |
|---|
| 797 | + resource_size(&pdev->resource[0]), "s1d13xxxfb mem")) { |
|---|
| 792 | 798 | dev_dbg(&pdev->dev, "request_mem_region failed\n"); |
|---|
| 793 | 799 | ret = -EBUSY; |
|---|
| 794 | 800 | goto bail; |
|---|
| 795 | 801 | } |
|---|
| 796 | 802 | |
|---|
| 797 | 803 | if (!request_mem_region(pdev->resource[1].start, |
|---|
| 798 | | - pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) { |
|---|
| 804 | + resource_size(&pdev->resource[1]), "s1d13xxxfb regs")) { |
|---|
| 799 | 805 | dev_dbg(&pdev->dev, "request_mem_region failed\n"); |
|---|
| 800 | 806 | ret = -EBUSY; |
|---|
| 801 | 807 | goto bail; |
|---|
| .. | .. |
|---|
| 809 | 815 | |
|---|
| 810 | 816 | platform_set_drvdata(pdev, info); |
|---|
| 811 | 817 | default_par = info->par; |
|---|
| 812 | | - default_par->regs = ioremap_nocache(pdev->resource[1].start, |
|---|
| 813 | | - pdev->resource[1].end - pdev->resource[1].start +1); |
|---|
| 818 | + default_par->regs = ioremap(pdev->resource[1].start, |
|---|
| 819 | + resource_size(&pdev->resource[1])); |
|---|
| 814 | 820 | if (!default_par->regs) { |
|---|
| 815 | 821 | printk(KERN_ERR PFX "unable to map registers\n"); |
|---|
| 816 | 822 | ret = -ENOMEM; |
|---|
| .. | .. |
|---|
| 818 | 824 | } |
|---|
| 819 | 825 | info->pseudo_palette = default_par->pseudo_palette; |
|---|
| 820 | 826 | |
|---|
| 821 | | - info->screen_base = ioremap_nocache(pdev->resource[0].start, |
|---|
| 822 | | - pdev->resource[0].end - pdev->resource[0].start +1); |
|---|
| 827 | + info->screen_base = ioremap(pdev->resource[0].start, |
|---|
| 828 | + resource_size(&pdev->resource[0])); |
|---|
| 823 | 829 | |
|---|
| 824 | 830 | if (!info->screen_base) { |
|---|
| 825 | 831 | printk(KERN_ERR PFX "unable to map framebuffer\n"); |
|---|
| .. | .. |
|---|
| 857 | 863 | |
|---|
| 858 | 864 | info->fix = s1d13xxxfb_fix; |
|---|
| 859 | 865 | info->fix.mmio_start = pdev->resource[1].start; |
|---|
| 860 | | - info->fix.mmio_len = pdev->resource[1].end - pdev->resource[1].start + 1; |
|---|
| 866 | + info->fix.mmio_len = resource_size(&pdev->resource[1]); |
|---|
| 861 | 867 | info->fix.smem_start = pdev->resource[0].start; |
|---|
| 862 | | - info->fix.smem_len = pdev->resource[0].end - pdev->resource[0].start + 1; |
|---|
| 868 | + info->fix.smem_len = resource_size(&pdev->resource[0]); |
|---|
| 863 | 869 | |
|---|
| 864 | 870 | printk(KERN_INFO PFX "regs mapped at 0x%p, fb %d KiB mapped at 0x%p\n", |
|---|
| 865 | 871 | default_par->regs, info->fix.smem_len / 1024, info->screen_base); |
|---|
| .. | .. |
|---|
| 895 | 901 | return 0; |
|---|
| 896 | 902 | |
|---|
| 897 | 903 | bail: |
|---|
| 898 | | - s1d13xxxfb_remove(pdev); |
|---|
| 904 | + __s1d13xxxfb_remove(pdev); |
|---|
| 899 | 905 | return ret; |
|---|
| 900 | 906 | |
|---|
| 901 | 907 | } |
|---|