From dc7e96507604173dcea9b29085ead9b97ebe1ce9 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Tue, 29 Nov 2016 11:34:49 +0800 Subject: [PATCH] Revert "iommu/rockchip: fix bool operation error and probe warning" This reverts commit e0492807e6b91becccbcab6eca1df27da55d726b. Same issue fixed by upstream(e04928 "iommu/rockchip: fix bool operation error and probe warning) which picked as (2e7026 "UPSTREAM: iommu/rockchip: Fix "is stall active" check). Conflicts: drivers/iommu/rockchip-iommu.c Signed-off-by: Jeffy Chen Change-Id: I56e61894b1da14bce78ae1b3d08158dfb5b027bb --- drivers/iommu/rockchip-iommu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 4f856a1a9492..650c7e42afe8 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -311,22 +311,24 @@ static void rk_iommu_zap_lines(struct rk_iommu *iommu, dma_addr_t iova_start, static bool rk_iommu_is_stall_active(struct rk_iommu *iommu) { - u32 active = RK_MMU_STATUS_STALL_ACTIVE; + bool active = true; int i; for (i = 0; i < iommu->num_mmu; i++) - active &= !!rk_iommu_read(iommu->bases[i], RK_MMU_STATUS); + active &= !!(rk_iommu_read(iommu->bases[i], RK_MMU_STATUS) & + RK_MMU_STATUS_STALL_ACTIVE); return active; } static bool rk_iommu_is_paging_enabled(struct rk_iommu *iommu) { - u32 enable = RK_MMU_STATUS_PAGING_ENABLED; + bool enable = true; int i; for (i = 0; i < iommu->num_mmu; i++) - enable &= !!rk_iommu_read(iommu->bases[i], RK_MMU_STATUS); + enable &= !!(rk_iommu_read(iommu->bases[i], RK_MMU_STATUS) & + RK_MMU_STATUS_PAGING_ENABLED); return enable; } @@ -1139,9 +1141,9 @@ static int rk_iommu_probe(struct platform_device *pdev) for (i = 0; i < num_res; i++) { res = platform_get_resource(pdev, IORESOURCE_MEM, i); - if (!res) - continue; iommu->bases[i] = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(iommu->bases[i])) + continue; iommu->num_mmu++; } if (iommu->num_mmu == 0) -- 2.34.1