diff mbox

drm/omap: Fix usage of IS_ERR_OR_NULL and PTR_ERR

Message ID 1352842892-2810-1-git-send-email-andy.gross@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Gross Nov. 13, 2012, 9:41 p.m. UTC
Return PTR_ERR(-ENOMEM) if dmm_txn_init cannot allocate a
refill engine.

Signed-off-by: Andy Gross <andy.gross@ti.com>
---
 drivers/staging/omapdrm/omap_dmm_tiler.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Rob Clark Nov. 13, 2012, 11:19 p.m. UTC | #1
On Tue, Nov 13, 2012 at 3:41 PM, Andy Gross <andy.gross@ti.com> wrote:
> Return PTR_ERR(-ENOMEM) if dmm_txn_init cannot allocate a
> refill engine.
>
> Signed-off-by: Andy Gross <andy.gross@ti.com>

Signed-off-by: Rob Clark <rob@ti.com>

> ---
>  drivers/staging/omapdrm/omap_dmm_tiler.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.c b/drivers/staging/omapdrm/omap_dmm_tiler.c
> index 3ae3955..1a5a7ca 100644
> --- a/drivers/staging/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/staging/omapdrm/omap_dmm_tiler.c
> @@ -279,7 +279,7 @@ static int fill(struct tcm_area *area, struct page **pages,
>
>         txn = dmm_txn_init(omap_dmm, area->tcm);
>         if (IS_ERR_OR_NULL(txn))
> -               return PTR_ERR(txn);
> +               return PTR_ERR(-ENOMEM);
>
>         tcm_for_each_slice(slice, *area, area_s) {
>                 struct pat_area p_area = {
> --
> 1.7.5.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula Nov. 23, 2012, 8:10 a.m. UTC | #2
On Tue, 13 Nov 2012, Andy Gross <andy.gross@ti.com> wrote:
> Return PTR_ERR(-ENOMEM) if dmm_txn_init cannot allocate a
> refill engine.
>
> Signed-off-by: Andy Gross <andy.gross@ti.com>
> ---
>  drivers/staging/omapdrm/omap_dmm_tiler.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.c b/drivers/staging/omapdrm/omap_dmm_tiler.c
> index 3ae3955..1a5a7ca 100644
> --- a/drivers/staging/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/staging/omapdrm/omap_dmm_tiler.c
> @@ -279,7 +279,7 @@ static int fill(struct tcm_area *area, struct page **pages,
>  
>  	txn = dmm_txn_init(omap_dmm, area->tcm);
>  	if (IS_ERR_OR_NULL(txn))
> -		return PTR_ERR(txn);
> +		return PTR_ERR(-ENOMEM);

return -ENOMEM;

BR,
Jani.

>  
>  	tcm_for_each_slice(slice, *area, area_s) {
>  		struct pat_area p_area = {
> -- 
> 1.7.5.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.c b/drivers/staging/omapdrm/omap_dmm_tiler.c
index 3ae3955..1a5a7ca 100644
--- a/drivers/staging/omapdrm/omap_dmm_tiler.c
+++ b/drivers/staging/omapdrm/omap_dmm_tiler.c
@@ -279,7 +279,7 @@  static int fill(struct tcm_area *area, struct page **pages,
 
 	txn = dmm_txn_init(omap_dmm, area->tcm);
 	if (IS_ERR_OR_NULL(txn))
-		return PTR_ERR(txn);
+		return PTR_ERR(-ENOMEM);
 
 	tcm_for_each_slice(slice, *area, area_s) {
 		struct pat_area p_area = {