Commit 74cfa956 authored by Baolin Wang's avatar Baolin Wang Committed by Bjorn Andersson

hwspinlock: sprd: Change to use devm_platform_ioremap_resource()

Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together, which can simpify the code.
Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent acc98c1f
......@@ -83,7 +83,6 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
{
struct sprd_hwspinlock_dev *sprd_hwlock;
struct hwspinlock *lock;
struct resource *res;
int i, ret;
if (!pdev->dev.of_node)
......@@ -96,8 +95,7 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
if (!sprd_hwlock)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
sprd_hwlock->base = devm_ioremap_resource(&pdev->dev, res);
sprd_hwlock->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(sprd_hwlock->base))
return PTR_ERR(sprd_hwlock->base);
......
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