Skip to content

Commit 0a8c264

Browse files
bbkzzwilldeacon
authored andcommitted
iommu/arm-smmu: Clean up resource handling during Qualcomm context probe
Convert to use devm_platform_ioremap_resource() and fix return value when platform_get_irq fails. Signed-off-by: Yangtao Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 1672730 commit 0a8c264

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/iommu/arm/arm-smmu/qcom_iommu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev)
633633
struct qcom_iommu_ctx *ctx;
634634
struct device *dev = &pdev->dev;
635635
struct qcom_iommu_dev *qcom_iommu = dev_get_drvdata(dev->parent);
636-
struct resource *res;
637636
int ret, irq;
638637

639638
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
@@ -643,14 +642,13 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev)
643642
ctx->dev = dev;
644643
platform_set_drvdata(pdev, ctx);
645644

646-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
647-
ctx->base = devm_ioremap_resource(dev, res);
645+
ctx->base = devm_platform_ioremap_resource(pdev, 0);
648646
if (IS_ERR(ctx->base))
649647
return PTR_ERR(ctx->base);
650648

651649
irq = platform_get_irq(pdev, 0);
652650
if (irq < 0)
653-
return -ENODEV;
651+
return irq;
654652

655653
/* clear IRQs before registering fault handler, just in case the
656654
* boot-loader left us a surprise:

0 commit comments

Comments
 (0)