aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memory/mvebu-devbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/memory/mvebu-devbus.c')
-rw-r--r--drivers/memory/mvebu-devbus.c15
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,
108 node->full_name); 108 node->full_name);
109 return err; 109 return err;
110 } 110 }
111 /* Convert bit width to byte width */ 111
112 r.bus_width /= 8; 112 /*
113 * The bus width is encoded into the register as 0 for 8 bits,
114 * and 1 for 16 bits, so we do the necessary conversion here.
115 */
116 if (r.bus_width == 8)
117 r.bus_width = 0;
118 else if (r.bus_width == 16)
119 r.bus_width = 1;
120 else {
121 dev_err(devbus->dev, "invalid bus width %d\n", r.bus_width);
122 return -EINVAL;
123 }
113 124
114 err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps", 125 err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps",
115 &r.badr_skew); 126 &r.badr_skew);