Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1453010

[PATCH] iommu/exynos: Modify error handling

Path csiph.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From Amitoj Kaur Chawla <amitoj1606@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] iommu/exynos: Modify error handling
Date Mon, 01 Aug 2016 09:20:02 +0200
Message-ID <s1fG2-3cM-3@gated-at.bofh.it> (permalink)
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=vXGbha1Tyv9Ok+H90GqvmvtK9q4EggdzKLjzb8HvYIM=; b=wXc7v8wVf9hNtXA7qr8PnHcGmWWVxEn+RdtmGZuuZLKZ4cMUcy4wODrk3F1MPIt+dt hqX5jRftWWXeCHUWFprG4yWKylRti8z7QWklIfPm5hsqoyrx4emm2eYEFhSTcQ+NuhNu 11Odv3IsRMO0cYVhlyophYNkSVlPHc7iqTBg758VwIbOOWzbTjDgCVXgzwV4HtLtVZeV XFSPcCqEH11wvbUQqBL7MKpReINgjt1EC8WwIoi/Vzw9fAApkiprRwKHshC5zW8P7Q85 pf1MRYMNkpneu90VT07C9IfrdYulL9Kz9XRuS2FC8SsSuX+uVnm9gSGzDot3pLizVap/ 4YLQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=vXGbha1Tyv9Ok+H90GqvmvtK9q4EggdzKLjzb8HvYIM=; b=dyOT22AlD7SY5kaPv8vLlDU+a7IKDIaW1syDCsIuV6bPUpqwX6JySMHSo37n/eHOCY AF6HFCHJFFp8RtT1O8gIn/W1xlBp0mNT9S2JPWgBpIAVFxImDp0X2151wWKkMnKInbBz uapozNmx/kD310XNvr+BRWLKZLd1nf5zcfjQ99GQlPoIuMu9Rcqq/QW0ErAQ4g5M2IQX gtn1S2piTlaWaF/g12iCXSl2tkv1HJ/iEGUPsyNm0EJWxzn4mWL9BkE9nhdxjvYiAToy m+s8Gw3XTDzyoizJVwgqvtaSU+DTAZhB0bUT9wM75sGiUrwfCr2GDj5gpB30nUjxCD4x 5NnQ==
X-Gm-Message-State AEkoouvHy3yDpw1MWcSpags0ujbSJuoBeGJRNk5uEEFfqfbDAumB35aN7uaz3Zf8upjU/w==
X-Received by 10.67.7.9 with SMTP id cy9mr88046804pad.155.1470032322693; Sun, 31 Jul 2016 23:18:42 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 44
Organization linux.* mail to news gateway
X-Original-Cc julia.lawall@lip6.fr
X-Original-Date Mon, 1 Aug 2016 11:48:38 +0530
X-Original-Message-ID <20160801061838.GA17805@amitoj-Inspiron-3542>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1453010

Show key headers only | View raw


of_platform_device_create returns NULL on error so an IS_ERR test is
incorrect here and a NULL check is required.

The Coccinelle semantic patch used to make this change is as follows:
@@
expression e;
@@

  e = of_platform_device_create(...);
if(
-    IS_ERR(e)
+    !e
    )
    {
  <+...
  return
- PTR_ERR(e)
+ -ENODEV
  ;
  ...+>
  }

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 97c41b8..2888bbf 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1242,8 +1242,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENODEV;
 
 	of_iommu_set_ops(np, &exynos_iommu_ops);
 	return 0;
-- 
1.9.1

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] iommu/exynos: Modify error handling Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-08-01 09:20 +0200
  Re: [PATCH] iommu/exynos: Modify error handling Joerg Roedel <joro@8bytes.org> - 2016-08-09 17:30 +0200

csiph-web