diff options
author | Olof Johansson <olof@lixom.net> | 2014-05-05 09:27:30 +0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-05-05 09:27:30 +0400 |
commit | 1270f063f95c9c57c59b60c7122603e633c6e276 (patch) | |
tree | bb6e89b26f3f241108e6a4dff105aa712e6c78cc /drivers | |
parent | 9a2044fce2021358e082d344b8c248e83b1c499b (diff) | |
parent | 1cc9d48145b81e307fab94a5cf6ee66ec2f0de60 (diff) | |
download | linux-1270f063f95c9c57c59b60c7122603e633c6e276.tar.xz |
Merge tag 'mvebu-fixes-3.15' of git://git.infradead.org/linux-mvebu into fixes
From Jason Cooper:
mvebu fixes for v3.15
- devbus: fix bus-width conversion
- orion5x: fix target ID for crypto SRAM window
* tag 'mvebu-fixes-3.15' of git://git.infradead.org/linux-mvebu:
ARM: orion5x: fix target ID for crypto SRAM window
memory: mvebu-devbus: fix the conversion of the bus width
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/memory/mvebu-devbus.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/memory/mvebu-devbus.c b/drivers/memory/mvebu-devbus.c index 110c03627051..b59a17fb7c3e 100644 --- a/drivers/memory/mvebu-devbus.c +++ b/drivers/memory/mvebu-devbus.c @@ -108,8 +108,19 @@ static int devbus_set_timing_params(struct devbus *devbus, node->full_name); return err; } - /* Convert bit width to byte width */ - r.bus_width /= 8; + + /* + * The bus width is encoded into the register as 0 for 8 bits, + * and 1 for 16 bits, so we do the necessary conversion here. + */ + if (r.bus_width == 8) + r.bus_width = 0; + else if (r.bus_width == 16) + r.bus_width = 1; + else { + dev_err(devbus->dev, "invalid bus width %d\n", r.bus_width); + return -EINVAL; + } err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps", &r.badr_skew); |