mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
hw: Mark nd_table[] misuse in realize methods FIXME
nd_table[] contains NIC configuration for boards to pick up. Device code has no business looking there. Several devices do it anyway. Two of them already have a suitable FIXME comment: "allwinner-a10" and "msf2-soc". Copy it to the others: "allwinner-h3", "xlnx-versal", "xlnx,zynqmp", "sparc32-ledma", "riscv.sifive.u.soc". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200715140440.3540942-3-armbru@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
2b0650205b
commit
7ad36e2e24
5 changed files with 5 additions and 0 deletions
|
@ -358,6 +358,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
|
||||||
"sd-bus");
|
"sd-bus");
|
||||||
|
|
||||||
/* EMAC */
|
/* EMAC */
|
||||||
|
/* FIXME use qdev NIC properties instead of nd_table[] */
|
||||||
if (nd_table[0].used) {
|
if (nd_table[0].used) {
|
||||||
qemu_check_nic_model(&nd_table[0], TYPE_AW_SUN8I_EMAC);
|
qemu_check_nic_model(&nd_table[0], TYPE_AW_SUN8I_EMAC);
|
||||||
qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
|
qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
|
||||||
|
|
|
@ -160,6 +160,7 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
|
||||||
object_initialize_child(OBJECT(s), name, &s->lpd.iou.gem[i],
|
object_initialize_child(OBJECT(s), name, &s->lpd.iou.gem[i],
|
||||||
TYPE_CADENCE_GEM);
|
TYPE_CADENCE_GEM);
|
||||||
dev = DEVICE(&s->lpd.iou.gem[i]);
|
dev = DEVICE(&s->lpd.iou.gem[i]);
|
||||||
|
/* FIXME use qdev NIC properties instead of nd_table[] */
|
||||||
if (nd->used) {
|
if (nd->used) {
|
||||||
qemu_check_nic_model(nd, "cadence_gem");
|
qemu_check_nic_model(nd, "cadence_gem");
|
||||||
qdev_set_nic_properties(dev, nd);
|
qdev_set_nic_properties(dev, nd);
|
||||||
|
|
|
@ -455,6 +455,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
||||||
for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
|
for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
|
||||||
NICInfo *nd = &nd_table[i];
|
NICInfo *nd = &nd_table[i];
|
||||||
|
|
||||||
|
/* FIXME use qdev NIC properties instead of nd_table[] */
|
||||||
if (nd->used) {
|
if (nd->used) {
|
||||||
qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
|
qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
|
||||||
qdev_set_nic_properties(DEVICE(&s->gem[i]), nd);
|
qdev_set_nic_properties(DEVICE(&s->gem[i]), nd);
|
||||||
|
|
|
@ -341,6 +341,7 @@ static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp)
|
||||||
DeviceState *d;
|
DeviceState *d;
|
||||||
NICInfo *nd = &nd_table[0];
|
NICInfo *nd = &nd_table[0];
|
||||||
|
|
||||||
|
/* FIXME use qdev NIC properties instead of nd_table[] */
|
||||||
qemu_check_nic_model(nd, TYPE_LANCE);
|
qemu_check_nic_model(nd, TYPE_LANCE);
|
||||||
|
|
||||||
d = qdev_new(TYPE_LANCE);
|
d = qdev_new(TYPE_LANCE);
|
||||||
|
|
|
@ -714,6 +714,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_OTP].base);
|
sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_OTP].base);
|
||||||
|
|
||||||
|
/* FIXME use qdev NIC properties instead of nd_table[] */
|
||||||
if (nd->used) {
|
if (nd->used) {
|
||||||
qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
|
qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
|
||||||
qdev_set_nic_properties(DEVICE(&s->gem), nd);
|
qdev_set_nic_properties(DEVICE(&s->gem), nd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue