diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2014-01-07 08:38:12 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-01-20 14:37:29 -0500 |
commit | 840f53c31224d687a7c4a24ea118fa3c737407b0 (patch) | |
tree | ae5bc1f685c50926b397318f7c3e301dd8fbb67b /drivers/mtd | |
parent | 4968a4124cf2df4b3672eed4714c6755f10f400c (diff) |
mtd: plat_nand: remove redundant return value check of platform_get_resource()
Remove unneeded error handling on the result of a call
to platform_get_resource() when the value is passed to
devm_ioremap_resource(). And move those two call together
to make the connection between them more clear.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/plat_nand.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index 4ebed7273bc0..0b068a5c0bff 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c | |||
@@ -48,16 +48,13 @@ static int plat_nand_probe(struct platform_device *pdev) | |||
48 | return -EINVAL; | 48 | return -EINVAL; |
49 | } | 49 | } |
50 | 50 | ||
51 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
52 | if (!res) | ||
53 | return -ENXIO; | ||
54 | |||
55 | /* Allocate memory for the device structure (and zero it) */ | 51 | /* Allocate memory for the device structure (and zero it) */ |
56 | data = devm_kzalloc(&pdev->dev, sizeof(struct plat_nand_data), | 52 | data = devm_kzalloc(&pdev->dev, sizeof(struct plat_nand_data), |
57 | GFP_KERNEL); | 53 | GFP_KERNEL); |
58 | if (!data) | 54 | if (!data) |
59 | return -ENOMEM; | 55 | return -ENOMEM; |
60 | 56 | ||
57 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
61 | data->io_base = devm_ioremap_resource(&pdev->dev, res); | 58 | data->io_base = devm_ioremap_resource(&pdev->dev, res); |
62 | if (IS_ERR(data->io_base)) | 59 | if (IS_ERR(data->io_base)) |
63 | return PTR_ERR(data->io_base); | 60 | return PTR_ERR(data->io_base); |