diff options
author | Alessandro Rubini <rubini@gnudd.com> | 2014-01-30 07:05:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-15 14:51:04 -0500 |
commit | 83b1bfba100c1e747c281049255a4a32197c6393 (patch) | |
tree | 3479503e77a84d88a969067017e630699e37a04e | |
parent | e4d6c4b79cc189c1b0d65f8e3875c4411e097bee (diff) |
FMC: show_sdb_tree: fix offset calculation
The code reported wrong addresses in the sdb dumps. All sdb addresses
are relative, but the code was adding the base address twice. Bug
exposed by a gateware image with two bridge levels.
Thanks David for reporting the problem.
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Reported-by: Juan David Gonzalez Cobas <dcobas@cern.ch>
Tested-by: Juan David Gonzalez Cobas <dcobas@cern.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/fmc/fmc-sdb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/fmc/fmc-sdb.c b/drivers/fmc/fmc-sdb.c index 79adc39221ea..69f42d70bc74 100644 --- a/drivers/fmc/fmc-sdb.c +++ b/drivers/fmc/fmc-sdb.c | |||
@@ -153,20 +153,17 @@ EXPORT_SYMBOL(fmc_reprogram); | |||
153 | static void __fmc_show_sdb_tree(const struct fmc_device *fmc, | 153 | static void __fmc_show_sdb_tree(const struct fmc_device *fmc, |
154 | const struct sdb_array *arr) | 154 | const struct sdb_array *arr) |
155 | { | 155 | { |
156 | unsigned long base = arr->baseaddr; | ||
156 | int i, j, n = arr->len, level = arr->level; | 157 | int i, j, n = arr->len, level = arr->level; |
157 | const struct sdb_array *ap; | ||
158 | 158 | ||
159 | for (i = 0; i < n; i++) { | 159 | for (i = 0; i < n; i++) { |
160 | unsigned long base; | ||
161 | union sdb_record *r; | 160 | union sdb_record *r; |
162 | struct sdb_product *p; | 161 | struct sdb_product *p; |
163 | struct sdb_component *c; | 162 | struct sdb_component *c; |
164 | r = &arr->record[i]; | 163 | r = &arr->record[i]; |
165 | c = &r->dev.sdb_component; | 164 | c = &r->dev.sdb_component; |
166 | p = &c->product; | 165 | p = &c->product; |
167 | base = 0; | 166 | |
168 | for (ap = arr; ap; ap = ap->parent) | ||
169 | base += ap->baseaddr; | ||
170 | dev_info(&fmc->dev, "SDB: "); | 167 | dev_info(&fmc->dev, "SDB: "); |
171 | 168 | ||
172 | for (j = 0; j < level; j++) | 169 | for (j = 0; j < level; j++) |