sd: Fix "info qtree" on boards with SD cards
The SD card object is not a SysBusDevice, so don't create it with qdev_create() if we're not assigning it to a specific bus; use object_new() instead. This was causing 'info qtree' to segfault on boards with SD cards, because qdev_create(NULL, TYPE_FOO) puts the created object on the system bus, and then we may try to run functions like sysbus_dev_print() on it, which fail when casting the object to SysBusDevice. (This is the same mistake that we made with the NAND device and fixed in commit 6749695e.) Reported-by: Nxiaoqiang.zhao <zxq_yx_007@163.com> Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: Nxiaoqiang.zhao <zxq_yx_007@163.com> Message-id: 1458061009-7733-1-git-send-email-peter.maydell@linaro.org
Showing
想要评论请 注册 或 登录