Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758722Ab3GZLbH (ORCPT ); Fri, 26 Jul 2013 07:31:07 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:51238 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756914Ab3GZLbD (ORCPT ); Fri, 26 Jul 2013 07:31:03 -0400 X-AuditID: cbfee68f-b7f436d000000f81-eb-51f25df620b8 From: Cho KyongHo To: "'Linux ARM Kernel'" , "'Linux IOMMU'" , "'Linux Kernel'" , "'Linux Samsung SOC'" Cc: "'Hyunwoong Kim'" , "'Joerg Roedel'" , "'Kukjin Kim'" , "'Prathyush'" , "'Rahul Sharma'" , "'Subash Patel'" , "'Keyyoung Park'" , "'Grant Grundler'" , "'Antonios Motakis'" , kvmarm@lists.cs.columbia.edu, "'Sachin Kamat'" Subject: [PATCH v8 12/12] iommu/exynos: return 0 if iommu_attach_device() successes Date: Fri, 26 Jul 2013 20:31:01 +0900 Message-id: <004201ce89f3$9b849a20$d28dce60$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac6J8ddcRcOchBS4TTmrJyDxnOe5pw== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42I5/e+Zse632E+BBjd+c1vcuXuO1eLVkR9M Fgv2W1t0zt7AbrH54DoWi94FV9ksGu9NYLP4eOo4u8Wmx9dYLS7vmsNmMeP8PiaLCys2sltM WXSY1eLkn15Gi5brvUwO/B5PDs5j8pjdcJHF4861PWwe5zetYfbYvKTeY/KN5YwefVtWMXp8 3iTnceXoGaYAzigum5TUnMyy1CJ9uwSujM4NHUwFt3kqVq77ytrAuIuri5GDQ0LARGLy0vQu Rk4gU0ziwr31bF2MXBxCAssYJa717GaEqXn7pRoiPp1Rovv6ZKiiv4wSPy89ZwPpZhPQklg9 9zg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7b7JDGELSvyYfA+shhlo6Pqdx5kgbHmJzWveMkOcpCCx4+xrqGV6Er/fdTFD1IhI7Hvx jnECo8AsJKNmIRk1C8moWUhaFjCyrGIUTS1ILihOSs811CtOzC0uzUvXS87P3cQITjHPpHYw rmywOMQowMGoxMOr4PQxUIg1say4MvcQowQHs5II73XvT4FCvCmJlVWpRfnxRaU5qcWHGJOB Pp3ILCWanA9Mf3kl8YbGJmZGlkZmFkYm5uakCSuJ8x5otQ4UEkhPLEnNTk0tSC2C2cLEwSnV wJgYs8vizvqKa5c/92yfVsn69JFXlWTCC5mCqUKsye+XHPETbQ5P/vp1caWVm99BR8Hbh+KE xbJuZnPsb+EUMFvSatAXoB0eynYudE09Q3Ti5LlaafFNp5rVj+xTm++uVrwgndvd/Ur41Akz 4wM/zWwX718R1uul9Mdxd7XUb9aygzo3/GX9lFiKMxINtZiLihMB2CXocnUDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1825 Lines: 52 iommu_attach_device() against exynos-iommu positive integer on success if the caller calls iommu_attach_device() with the same iommu_domain multiple times without call to iommu_detach_device() to inform the caller how many calls to iommu_detach_device() to really detach iommu. However the convention of the return value of success of common API is zero, this patch makes iommu_attach_device() call against exynos-iommu always return zero if the given device is successfully attached to the given iommu_domain even though it is already attached to the same iommu_domain. Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 51e5b35..6eed6d6 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -882,15 +882,16 @@ static int exynos_iommu_attach_device(struct iommu_domain *domain, spin_unlock_irqrestore(&priv->lock, flags); - if (ret < 0) + if (ret < 0) { dev_err(dev, "%s: Failed to attach IOMMU with pgtable %#lx\n", __func__, __pa(priv->pgtable)); - else - dev_dbg(dev, "%s: Attached IOMMU with pgtable 0x%lx%s\n", - __func__, __pa(priv->pgtable), - (ret == 0) ? "" : ", again"); + return ret; + } - return ret; + dev_dbg(dev, "%s: Attached IOMMU with pgtable 0x%lx%s\n", + __func__, __pa(priv->pgtable), (ret == 0) ? "" : ", again"); + + return 0; } static void exynos_iommu_detach_device(struct iommu_domain *domain, -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/