Skip to content

Commit

Permalink
hwspinlock: sprd: Change to use devm_platform_ioremap_resource()
Browse files Browse the repository at this point in the history
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: Baolin Wang <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
  • Loading branch information
wangbaolin719 authored and andersson committed Oct 5, 2019
1 parent acc98c1 commit 74cfa95
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/hwspinlock/sprd_hwspinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);

Expand Down

0 comments on commit 74cfa95

Please sign in to comment.