Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee4fec5f authored by Wei Yongjun's avatar Wei Yongjun Committed by Alexandre Belloni
Browse files

memory: atmel-ebi: use PTR_ERR_OR_ZERO() to simplify the code



Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.

Generated by coccinelle.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 29b4817d
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -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,