Commit 4e84d0a6 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Krzysztof Kozlowski

memory: tegra: Use devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() helper which makes code a bit
cleaner.
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20201104164923.21238-30-digetx@gmail.comSigned-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 6c6bd207
...@@ -1179,7 +1179,6 @@ static int tegra_emc_probe(struct platform_device *pdev) ...@@ -1179,7 +1179,6 @@ static int tegra_emc_probe(struct platform_device *pdev)
{ {
struct device_node *np; struct device_node *np;
struct tegra_emc *emc; struct tegra_emc *emc;
struct resource *res;
u32 ram_code; u32 ram_code;
int err; int err;
...@@ -1189,8 +1188,7 @@ static int tegra_emc_probe(struct platform_device *pdev) ...@@ -1189,8 +1188,7 @@ static int tegra_emc_probe(struct platform_device *pdev)
emc->dev = &pdev->dev; emc->dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); emc->regs = devm_platform_ioremap_resource(pdev, 0);
emc->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(emc->regs)) if (IS_ERR(emc->regs))
return PTR_ERR(emc->regs); return PTR_ERR(emc->regs);
......
...@@ -654,7 +654,6 @@ static int tegra_emc_probe(struct platform_device *pdev) ...@@ -654,7 +654,6 @@ static int tegra_emc_probe(struct platform_device *pdev)
{ {
struct device_node *np; struct device_node *np;
struct tegra_emc *emc; struct tegra_emc *emc;
struct resource *res;
int irq, err; int irq, err;
/* driver has nothing to do in a case of memory timing absence */ /* driver has nothing to do in a case of memory timing absence */
...@@ -689,8 +688,7 @@ static int tegra_emc_probe(struct platform_device *pdev) ...@@ -689,8 +688,7 @@ static int tegra_emc_probe(struct platform_device *pdev)
if (err) if (err)
return err; return err;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); emc->regs = devm_platform_ioremap_resource(pdev, 0);
emc->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(emc->regs)) if (IS_ERR(emc->regs))
return PTR_ERR(emc->regs); return PTR_ERR(emc->regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment