iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [patch] iommu/exynos: checking for IS_ERR() instead of NULL
@ 2016-03-02 10:10 Dan Carpenter
  2016-03-02 12:47 ` Marek Szyprowski
  2016-03-02 14:53 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-03-02 10:10 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Krzysztof Kozlowski, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Kukjin Kim

of_platform_device_create() returns NULL on error, it never returns
error pointers.

Fixes: 8ed55c812fa8 ('iommu/exynos: Init from dt-specific callback instead of initcall')
Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index b066504..cb57bda 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1347,8 +1347,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 -ENOMEM;
 
 	/*
 	 * use the first registered sysmmu device for performing

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] iommu/exynos: checking for IS_ERR() instead of NULL
  2016-03-02 10:10 [patch] iommu/exynos: checking for IS_ERR() instead of NULL Dan Carpenter
@ 2016-03-02 12:47 ` Marek Szyprowski
  2016-03-02 14:53 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Szyprowski @ 2016-03-02 12:47 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Krzysztof Kozlowski, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Kukjin Kim

Hello,

On 2016-03-02 11:10, Dan Carpenter wrote:
> of_platform_device_create() returns NULL on error, it never returns
> error pointers.
>
> Fixes: 8ed55c812fa8 ('iommu/exynos: Init from dt-specific callback instead of initcall')
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Acked-by: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index b066504..cb57bda 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1347,8 +1347,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 -ENOMEM;
>   
>   	/*
>   	 * use the first registered sysmmu device for performing
>
>

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] iommu/exynos: checking for IS_ERR() instead of NULL
  2016-03-02 10:10 [patch] iommu/exynos: checking for IS_ERR() instead of NULL Dan Carpenter
  2016-03-02 12:47 ` Marek Szyprowski
@ 2016-03-02 14:53 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2016-03-02 14:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Krzysztof Kozlowski, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Kukjin Kim

On Wed, Mar 02, 2016 at 01:10:47PM +0300, Dan Carpenter wrote:
> of_platform_device_create() returns NULL on error, it never returns
> error pointers.
> 
> Fixes: 8ed55c812fa8 ('iommu/exynos: Init from dt-specific callback instead of initcall')
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-02 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-02 10:10 [patch] iommu/exynos: checking for IS_ERR() instead of NULL Dan Carpenter
2016-03-02 12:47 ` Marek Szyprowski
2016-03-02 14:53 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).