Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1347925 > unrolled thread
| Started by | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| First post | 2016-03-02 11:20 +0100 |
| Last post | 2016-03-02 16:00 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[patch] iommu/exynos: checking for IS_ERR() instead of NULL Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-02 11:20 +0100
Re: [patch] iommu/exynos: checking for IS_ERR() instead of NULL Marek Szyprowski <m.szyprowski@samsung.com> - 2016-03-02 13:50 +0100
Re: [patch] iommu/exynos: checking for IS_ERR() instead of NULL Joerg Roedel <joro@8bytes.org> - 2016-03-02 16:00 +0100
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-03-02 11:20 +0100 |
| Subject | [patch] iommu/exynos: checking for IS_ERR() instead of NULL |
| Message-ID | <r8c2S-6eY-13@gated-at.bofh.it> |
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@oracle.com>
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
[toc] | [next] | [standalone]
| From | Marek Szyprowski <m.szyprowski@samsung.com> |
|---|---|
| Date | 2016-03-02 13:50 +0100 |
| Message-ID | <r8eo1-7DD-5@gated-at.bofh.it> |
| In reply to | #1347925 |
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@oracle.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> 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
[toc] | [prev] | [next] | [standalone]
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2016-03-02 16:00 +0100 |
| Message-ID | <r8gpQ-Cq-1@gated-at.bofh.it> |
| In reply to | #1347925 |
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@oracle.com>
Applied, thanks.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web