[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1467806885-25578-1-git-send-email-weiyj_lk@163.com>
Date: Wed, 6 Jul 2016 12:08:05 +0000
From: weiyj_lk@....com
To: Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Nicolas Ferre <nicolas.ferre@...el.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>
Cc: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
linux-kernel@...r.kernel.org
Subject: [PATCH -next] memory: atmel-ebi: use PTR_ERR_OR_ZERO() to simplify the code
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.
Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
drivers/memory/atmel-ebi.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index f87ad6f..b5ed3bd 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -410,10 +410,7 @@ static int at91sam9_ebi_init(struct at91_ebi *ebi)
field.reg = AT91SAM9_SMC_MODE(AT91SAM9_SMC_GENERIC);
fields->mode = devm_regmap_field_alloc(ebi->dev, ebi->smc, field);
- if (IS_ERR(fields->mode))
- return PTR_ERR(fields->mode);
-
- return 0;
+ return PTR_ERR_OR_ZERO(fields->mode);
}
static int sama5d3_ebi_init(struct at91_ebi *ebi)
@@ -441,10 +438,7 @@ static int sama5d3_ebi_init(struct at91_ebi *ebi)
field.reg = SAMA5_SMC_MODE(SAMA5_SMC_GENERIC);
fields->mode = devm_regmap_field_alloc(ebi->dev, ebi->smc, field);
- if (IS_ERR(fields->mode))
- return PTR_ERR(fields->mode);
-
- return 0;
+ return PTR_ERR_OR_ZERO(fields->mode);
}
static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np,
Powered by blists - more mailing lists