summaryrefslogtreecommitdiff
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-19 21:32:28 -0700
committerBin Meng <bmeng.cn@gmail.com>2016-01-24 12:07:18 +0800
commitb565d66d2ca1748c9b0520fa4ba46b4a5dfa5468 (patch)
treee86809b916cfdd34deb0596eb735427cbee8cfa4 /arch/x86/lib
parentd3b884b294f1927d6599ddb243a7e6c7bb9aaef3 (diff)
downloadu-boot-imx-b565d66d2ca1748c9b0520fa4ba46b4a5dfa5468.zip
u-boot-imx-b565d66d2ca1748c9b0520fa4ba46b4a5dfa5468.tar.gz
u-boot-imx-b565d66d2ca1748c9b0520fa4ba46b4a5dfa5468.tar.bz2
x86: Use the IRQ device when setting up the mptable
Instead of searching for the device tree node, use the IRQ device which has a record of it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/mpspec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/lib/mpspec.c b/arch/x86/lib/mpspec.c
index f3ad116..0faa582 100644
--- a/arch/x86/lib/mpspec.c
+++ b/arch/x86/lib/mpspec.c
@@ -292,19 +292,19 @@ static int mptable_add_intsrc(struct mp_config_table *mc,
struct mpc_config_intsrc *intsrc_base;
int intsrc_entries = 0;
const void *blob = gd->fdt_blob;
- int node;
+ struct udevice *dev;
int len, count;
const u32 *cell;
- int i;
+ int i, ret;
- /* Get I/O interrupt information from device tree */
- node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_IRQ_ROUTER);
- if (node < 0) {
+ ret = uclass_first_device(UCLASS_IRQ, &dev);
+ if (ret && ret != -ENODEV) {
debug("%s: Cannot find irq router node\n", __func__);
- return -ENOENT;
+ return ret;
}
- cell = fdt_getprop(blob, node, "intel,pirq-routing", &len);
+ /* Get I/O interrupt information from device tree */
+ cell = fdt_getprop(blob, dev->of_offset, "intel,pirq-routing", &len);
if (!cell)
return -ENOENT;