From: Simon Date: Fri, 25 Mar 2016 01:57:24 +0000 (+0800) Subject: iommu/rockchip: fix devm_request_irq and devm_free_irq parameter X-Git-Tag: firefly_0821_release~3004 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=737923cf7d5cb5560d0b2f00c8c4248c70d6d623;p=firefly-linux-kernel-4.4.55.git iommu/rockchip: fix devm_request_irq and devm_free_irq parameter When rk_iommu_attach_device or rk_iommu_detach_device be called, the second parameter "dev" represent the device who own the iommu, so it is not resonable using "dev" for devm_request_irq's first parameter. To avoid potential error, we must use iommu device itself "iommu->dev" instead, the same as devm_free_irq. Change-Id: Id9f4097d6f1b916308475854dcf75ce86d9494fc Signed-off-by: Simon --- diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 7f848a202d1f..cd6c40a74b72 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -805,7 +805,7 @@ static int rk_iommu_attach_device(struct iommu_domain *domain, iommu->domain = domain; - ret = devm_request_irq(dev, iommu->irq, rk_iommu_irq, + ret = devm_request_irq(iommu->dev, iommu->irq, rk_iommu_irq, IRQF_SHARED, dev_name(dev), iommu); if (ret) return ret; @@ -858,7 +858,7 @@ static void rk_iommu_detach_device(struct iommu_domain *domain, } rk_iommu_disable_stall(iommu); - devm_free_irq(dev, iommu->irq, iommu); + devm_free_irq(iommu->dev, iommu->irq, iommu); iommu->domain = NULL;