diff options
| -rw-r--r-- | drivers/mtd/devices/spear_smi.c | 7 | ||||
| -rw-r--r-- | drivers/mtd/maps/autcpu12-nvram.c | 9 | ||||
| -rw-r--r-- | drivers/mtd/maps/lantiq-flash.c | 8 | ||||
| -rw-r--r-- | drivers/mtd/nand/fsmc_nand.c | 33 | ||||
| -rw-r--r-- | drivers/mtd/nand/lpc32xx_mlc.c | 9 | ||||
| -rw-r--r-- | drivers/mtd/nand/lpc32xx_slc.c | 8 | ||||
| -rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 12 | ||||
| -rw-r--r-- | drivers/mtd/nand/s3c2410.c | 7 | ||||
| -rw-r--r-- | drivers/mtd/nand/txx9ndfmc.c | 7 |
9 files changed, 44 insertions, 56 deletions
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index 2aabd96bf0ff..8a82b8bc21e1 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c | |||
| @@ -949,10 +949,9 @@ static int spear_smi_probe(struct platform_device *pdev) | |||
| 949 | 949 | ||
| 950 | smi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 950 | smi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 951 | 951 | ||
| 952 | dev->io_base = devm_request_and_ioremap(&pdev->dev, smi_base); | 952 | dev->io_base = devm_ioremap_resource(&pdev->dev, smi_base); |
| 953 | if (!dev->io_base) { | 953 | if (IS_ERR(dev->io_base)) { |
| 954 | ret = -EIO; | 954 | ret = PTR_ERR(dev->io_base); |
| 955 | dev_err(&pdev->dev, "devm_request_and_ioremap fail\n"); | ||
| 956 | goto err; | 955 | goto err; |
| 957 | } | 956 | } |
| 958 | 957 | ||
diff --git a/drivers/mtd/maps/autcpu12-nvram.c b/drivers/mtd/maps/autcpu12-nvram.c index a2dc2ae4b24e..c3525d2a2fa8 100644 --- a/drivers/mtd/maps/autcpu12-nvram.c +++ b/drivers/mtd/maps/autcpu12-nvram.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | */ | 18 | */ |
| 19 | #include <linux/err.h> | ||
| 19 | #include <linux/sizes.h> | 20 | #include <linux/sizes.h> |
| 20 | 21 | ||
| 21 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| @@ -55,12 +56,10 @@ static int autcpu12_nvram_probe(struct platform_device *pdev) | |||
| 55 | priv->map.bankwidth = 4; | 56 | priv->map.bankwidth = 4; |
| 56 | priv->map.phys = res->start; | 57 | priv->map.phys = res->start; |
| 57 | priv->map.size = resource_size(res); | 58 | priv->map.size = resource_size(res); |
| 58 | priv->map.virt = devm_request_and_ioremap(&pdev->dev, res); | 59 | priv->map.virt = devm_ioremap_resource(&pdev->dev, res); |
| 59 | strcpy((char *)priv->map.name, res->name); | 60 | strcpy((char *)priv->map.name, res->name); |
| 60 | if (!priv->map.virt) { | 61 | if (IS_ERR(priv->map.virt)) |
| 61 | dev_err(&pdev->dev, "failed to remap mem resource\n"); | 62 | return PTR_ERR(priv->map.virt); |
| 62 | return -EBUSY; | ||
| 63 | } | ||
| 64 | 63 | ||
| 65 | simple_map_init(&priv->map); | 64 | simple_map_init(&priv->map); |
| 66 | 65 | ||
diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c index 3c3c791eb96a..d1da6ede3845 100644 --- a/drivers/mtd/maps/lantiq-flash.c +++ b/drivers/mtd/maps/lantiq-flash.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * Copyright (C) 2010 John Crispin <blogic@openwrt.org> | 7 | * Copyright (C) 2010 John Crispin <blogic@openwrt.org> |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/err.h> | ||
| 10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 11 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| @@ -136,10 +137,9 @@ ltq_mtd_probe(struct platform_device *pdev) | |||
| 136 | ltq_mtd->map = kzalloc(sizeof(struct map_info), GFP_KERNEL); | 137 | ltq_mtd->map = kzalloc(sizeof(struct map_info), GFP_KERNEL); |
| 137 | ltq_mtd->map->phys = ltq_mtd->res->start; | 138 | ltq_mtd->map->phys = ltq_mtd->res->start; |
| 138 | ltq_mtd->map->size = resource_size(ltq_mtd->res); | 139 | ltq_mtd->map->size = resource_size(ltq_mtd->res); |
| 139 | ltq_mtd->map->virt = devm_request_and_ioremap(&pdev->dev, ltq_mtd->res); | 140 | ltq_mtd->map->virt = devm_ioremap_resource(&pdev->dev, ltq_mtd->res); |
| 140 | if (!ltq_mtd->map->virt) { | 141 | if (IS_ERR(ltq_mtd->map->virt)) { |
| 141 | dev_err(&pdev->dev, "failed to remap mem resource\n"); | 142 | err = PTR_ERR(ltq_mtd->map->virt); |
| 142 | err = -EBUSY; | ||
| 143 | goto err_out; | 143 | goto err_out; |
| 144 | } | 144 | } |
| 145 | 145 | ||
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c index 67e62d3d495c..c543cc09f193 100644 --- a/drivers/mtd/nand/fsmc_nand.c +++ b/drivers/mtd/nand/fsmc_nand.c | |||
| @@ -937,42 +937,35 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) | |||
| 937 | if (!res) | 937 | if (!res) |
| 938 | return -EINVAL; | 938 | return -EINVAL; |
| 939 | 939 | ||
| 940 | host->data_va = devm_request_and_ioremap(&pdev->dev, res); | 940 | host->data_va = devm_ioremap_resource(&pdev->dev, res); |
| 941 | if (!host->data_va) { | 941 | if (IS_ERR(host->data_va)) |
| 942 | dev_err(&pdev->dev, "data ioremap failed\n"); | 942 | return PTR_ERR(host->data_va); |
| 943 | return -ENOMEM; | 943 | |
| 944 | } | ||
| 945 | host->data_pa = (dma_addr_t)res->start; | 944 | host->data_pa = (dma_addr_t)res->start; |
| 946 | 945 | ||
| 947 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_addr"); | 946 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_addr"); |
| 948 | if (!res) | 947 | if (!res) |
| 949 | return -EINVAL; | 948 | return -EINVAL; |
| 950 | 949 | ||
| 951 | host->addr_va = devm_request_and_ioremap(&pdev->dev, res); | 950 | host->addr_va = devm_ioremap_resource(&pdev->dev, res); |
| 952 | if (!host->addr_va) { | 951 | if (IS_ERR(host->addr_va)) |
| 953 | dev_err(&pdev->dev, "ale ioremap failed\n"); | 952 | return PTR_ERR(host->addr_va); |
| 954 | return -ENOMEM; | ||
| 955 | } | ||
| 956 | 953 | ||
| 957 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd"); | 954 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd"); |
| 958 | if (!res) | 955 | if (!res) |
| 959 | return -EINVAL; | 956 | return -EINVAL; |
| 960 | 957 | ||
| 961 | host->cmd_va = devm_request_and_ioremap(&pdev->dev, res); | 958 | host->cmd_va = devm_ioremap_resource(&pdev->dev, res); |
| 962 | if (!host->cmd_va) { | 959 | if (IS_ERR(host->cmd_va)) |
| 963 | dev_err(&pdev->dev, "ale ioremap failed\n"); | 960 | return PTR_ERR(host->cmd_va); |
| 964 | return -ENOMEM; | ||
| 965 | } | ||
| 966 | 961 | ||
| 967 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fsmc_regs"); | 962 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fsmc_regs"); |
| 968 | if (!res) | 963 | if (!res) |
| 969 | return -EINVAL; | 964 | return -EINVAL; |
| 970 | 965 | ||
| 971 | host->regs_va = devm_request_and_ioremap(&pdev->dev, res); | 966 | host->regs_va = devm_ioremap_resource(&pdev->dev, res); |
| 972 | if (!host->regs_va) { | 967 | if (IS_ERR(host->regs_va)) |
| 973 | dev_err(&pdev->dev, "regs ioremap failed\n"); | 968 | return PTR_ERR(host->regs_va); |
| 974 | return -ENOMEM; | ||
| 975 | } | ||
| 976 | 969 | ||
| 977 | host->clk = clk_get(&pdev->dev, NULL); | 970 | host->clk = clk_get(&pdev->dev, NULL); |
| 978 | if (IS_ERR(host->clk)) { | 971 | if (IS_ERR(host->clk)) { |
diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c index f182befa7360..0ca22ae9135c 100644 --- a/drivers/mtd/nand/lpc32xx_mlc.c +++ b/drivers/mtd/nand/lpc32xx_mlc.c | |||
| @@ -677,11 +677,10 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) | |||
| 677 | return -ENXIO; | 677 | return -ENXIO; |
| 678 | } | 678 | } |
| 679 | 679 | ||
| 680 | host->io_base = devm_request_and_ioremap(&pdev->dev, rc); | 680 | host->io_base = devm_ioremap_resource(&pdev->dev, rc); |
| 681 | if (host->io_base == NULL) { | 681 | if (IS_ERR(host->io_base)) |
| 682 | dev_err(&pdev->dev, "ioremap failed\n"); | 682 | return PTR_ERR(host->io_base); |
| 683 | return -EIO; | 683 | |
| 684 | } | ||
| 685 | host->io_base_phy = rc->start; | 684 | host->io_base_phy = rc->start; |
| 686 | 685 | ||
| 687 | mtd = &host->mtd; | 686 | mtd = &host->mtd; |
diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c index 030b78c62895..be94ed5abefb 100644 --- a/drivers/mtd/nand/lpc32xx_slc.c +++ b/drivers/mtd/nand/lpc32xx_slc.c | |||
| @@ -778,11 +778,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) | |||
| 778 | } | 778 | } |
| 779 | host->io_base_dma = rc->start; | 779 | host->io_base_dma = rc->start; |
| 780 | 780 | ||
| 781 | host->io_base = devm_request_and_ioremap(&pdev->dev, rc); | 781 | host->io_base = devm_ioremap_resource(&pdev->dev, rc); |
| 782 | if (host->io_base == NULL) { | 782 | if (IS_ERR(host->io_base)) |
| 783 | dev_err(&pdev->dev, "ioremap failed\n"); | 783 | return PTR_ERR(host->io_base); |
| 784 | return -ENOMEM; | ||
| 785 | } | ||
| 786 | 784 | ||
| 787 | if (pdev->dev.of_node) | 785 | if (pdev->dev.of_node) |
| 788 | host->ncfg = lpc32xx_parse_dt(&pdev->dev); | 786 | host->ncfg = lpc32xx_parse_dt(&pdev->dev); |
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 45204e41a028..60ac5b98b718 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
| @@ -1437,9 +1437,9 @@ static int mxcnd_probe(struct platform_device *pdev) | |||
| 1437 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1437 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
