提交 2b8c92b4 编写于 作者: M Masahiro Yamada 提交者: Boris Brezillon

mtd: nand: denali_dt: clean up resource ioremap

No need to use two struct resource pointers.  Just reuse one.
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
上级 f82c3232
...@@ -49,7 +49,7 @@ MODULE_DEVICE_TABLE(of, denali_nand_dt_ids); ...@@ -49,7 +49,7 @@ MODULE_DEVICE_TABLE(of, denali_nand_dt_ids);
static int denali_dt_probe(struct platform_device *pdev) static int denali_dt_probe(struct platform_device *pdev)
{ {
struct resource *denali_reg, *nand_data; struct resource *res;
struct denali_dt *dt; struct denali_dt *dt;
const struct denali_dt_data *data; const struct denali_dt_data *data;
struct denali_nand_info *denali; struct denali_nand_info *denali;
...@@ -74,15 +74,13 @@ static int denali_dt_probe(struct platform_device *pdev) ...@@ -74,15 +74,13 @@ static int denali_dt_probe(struct platform_device *pdev)
return denali->irq; return denali->irq;
} }
denali_reg = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "denali_reg");
"denali_reg"); denali->flash_reg = devm_ioremap_resource(&pdev->dev, res);
denali->flash_reg = devm_ioremap_resource(&pdev->dev, denali_reg);
if (IS_ERR(denali->flash_reg)) if (IS_ERR(denali->flash_reg))
return PTR_ERR(denali->flash_reg); return PTR_ERR(denali->flash_reg);
nand_data = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_data");
"nand_data"); denali->flash_mem = devm_ioremap_resource(&pdev->dev, res);
denali->flash_mem = devm_ioremap_resource(&pdev->dev, nand_data);
if (IS_ERR(denali->flash_mem)) if (IS_ERR(denali->flash_mem))
return PTR_ERR(denali->flash_mem); return PTR_ERR(denali->flash_mem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册