Commit f11c34bd authored by Cai Huoqing's avatar Cai Huoqing Committed by Thierry Reding

firmware: tegra: bpmp: Use devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 06c2d9a0
...@@ -162,7 +162,6 @@ static int tegra210_bpmp_init(struct tegra_bpmp *bpmp) ...@@ -162,7 +162,6 @@ static int tegra210_bpmp_init(struct tegra_bpmp *bpmp)
{ {
struct platform_device *pdev = to_platform_device(bpmp->dev); struct platform_device *pdev = to_platform_device(bpmp->dev);
struct tegra210_bpmp *priv; struct tegra210_bpmp *priv;
struct resource *res;
unsigned int i; unsigned int i;
int err; int err;
...@@ -172,13 +171,11 @@ static int tegra210_bpmp_init(struct tegra_bpmp *bpmp) ...@@ -172,13 +171,11 @@ static int tegra210_bpmp_init(struct tegra_bpmp *bpmp)
bpmp->priv = priv; bpmp->priv = priv;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->atomics = devm_platform_ioremap_resource(pdev, 0);
priv->atomics = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->atomics)) if (IS_ERR(priv->atomics))
return PTR_ERR(priv->atomics); return PTR_ERR(priv->atomics);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); priv->arb_sema = devm_platform_ioremap_resource(pdev, 1);
priv->arb_sema = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->arb_sema)) if (IS_ERR(priv->arb_sema))
return PTR_ERR(priv->arb_sema); return PTR_ERR(priv->arb_sema);
......
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