summaryrefslogtreecommitdiffstats
path: root/drivers/memory/atmel-ebi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2017-08-30 23:15:31 +0200
committerMark Brown <broonie@kernel.org>2017-08-30 23:15:31 +0200
commitb388dc1f62a9bdd9c4758a0664e61d0f9a9da519 (patch)
tree696fd3c245700ee59ebcf3a65b90f8773b904624 /drivers/memory/atmel-ebi.c
parentASoC: remove duplicate definition of dapm_routes/num_dapm_routes (diff)
parentLinux 4.13-rc7 (diff)
downloadlinux-b388dc1f62a9bdd9c4758a0664e61d0f9a9da519.tar.xz
linux-b388dc1f62a9bdd9c4758a0664e61d0f9a9da519.zip
Merge tag 'v4.13-rc7' into asoc-component
Linux 4.13-rc7
Diffstat (limited to 'drivers/memory/atmel-ebi.c')
-rw-r--r--drivers/memory/atmel-ebi.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index 99e644cda4d1..ebf69ff48ae2 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -72,7 +72,7 @@ struct atmel_smc_timing_xlate {
{ .name = nm, .converter = atmel_smc_cs_conf_set_pulse, .shift = pos}
#define ATMEL_SMC_CYCLE_XLATE(nm, pos) \
- { .name = nm, .converter = atmel_smc_cs_conf_set_setup, .shift = pos}
+ { .name = nm, .converter = atmel_smc_cs_conf_set_cycle, .shift = pos}
static void at91sam9_ebi_get_config(struct atmel_ebi_dev *ebid,
struct atmel_ebi_dev_config *conf)
@@ -120,12 +120,14 @@ static int atmel_ebi_xslate_smc_timings(struct atmel_ebi_dev *ebid,
if (!ret) {
required = true;
ncycles = DIV_ROUND_UP(val, clk_period_ns);
- if (ncycles > ATMEL_SMC_MODE_TDF_MAX ||
- ncycles < ATMEL_SMC_MODE_TDF_MIN) {
+ if (ncycles > ATMEL_SMC_MODE_TDF_MAX) {
ret = -EINVAL;
goto out;
}
+ if (ncycles < ATMEL_SMC_MODE_TDF_MIN)
+ ncycles = ATMEL_SMC_MODE_TDF_MIN;
+
smcconf->mode |= ATMEL_SMC_MODE_TDF(ncycles);
}
@@ -263,7 +265,7 @@ static int atmel_ebi_xslate_smc_config(struct atmel_ebi_dev *ebid,
}
ret = atmel_ebi_xslate_smc_timings(ebid, np, &conf->smcconf);
- if (ret)
+ if (ret < 0)
return -EINVAL;
if ((ret > 0 && !required) || (!ret && required)) {