From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfTnp-0006JR-Kr for qemu-devel@nongnu.org; Fri, 04 Jan 2019 13:02:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfTnm-000668-Eg for qemu-devel@nongnu.org; Fri, 04 Jan 2019 13:02:37 -0500 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 4 Jan 2019 18:58:45 +0100 Message-Id: <20190104175847.6290-15-philmd@redhat.com> In-Reply-To: <20190104175847.6290-1-philmd@redhat.com> References: <20190104175847.6290-1-philmd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 14/16] hw/net/lan9118: Export TYPE_LAN9118 and use it instead of hardcoded string List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Thomas Huth Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" , Magnus Damm , David Gibson , Andrew Jeffery , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Joel Stanley , Peter Maydell , Andrzej Zaborowski , Igor Mitsyanko , Beniamino Galvani , Michael Walle , Richard Henderson , Jan Kiszka , Jason Wang , Gerd Hoffmann , Peter Chubb , Aurelien Jarno , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Bastian Koppelmann , Rob Herring , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/exynos4_boards.c | 3 ++- hw/arm/mps2-tz.c | 3 ++- hw/net/lan9118.c | 1 - include/hw/net/lan9118.h | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index 750162cc95..ea8100f65a 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -32,6 +32,7 @@ #include "hw/arm/arm.h" #include "exec/address-spaces.h" #include "hw/arm/exynos4210.h" +#include "hw/net/lan9118.h" #include "hw/boards.h" =20 #undef DEBUG @@ -92,7 +93,7 @@ static void lan9215_init(uint32_t base, qemu_irq irq) /* This should be a 9215 but the 9118 is close enough */ if (nd_table[0].used) { qemu_check_nic_model(&nd_table[0], "lan9118"); - dev =3D qdev_create(NULL, "lan9118"); + dev =3D qdev_create(NULL, TYPE_LAN9118); qdev_set_nic_properties(dev, &nd_table[0]); qdev_prop_set_uint32(dev, "mode_16bit", 1); qdev_init_nofail(dev); diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 1232d6ff95..b6a8693d7c 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -49,6 +49,7 @@ #include "hw/arm/iotkit.h" #include "hw/dma/pl080.h" #include "hw/ssi/pl022.h" +#include "hw/net/lan9118.h" #include "net/net.h" #include "hw/core/split-irq.h" =20 @@ -219,7 +220,7 @@ static MemoryRegion *make_eth_dev(MPS2TZMachineState = *mms, void *opaque, * except that it doesn't support the checksum-offload feature. */ qemu_check_nic_model(nd, "lan9118"); - mms->lan9118 =3D qdev_create(NULL, "lan9118"); + mms->lan9118 =3D qdev_create(NULL, TYPE_LAN9118); qdev_set_nic_properties(mms->lan9118, nd); qdev_init_nofail(mms->lan9118); =20 diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index a428b16eda..b29e3fee49 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -175,7 +175,6 @@ static const VMStateDescription vmstate_lan9118_packe= t =3D { } }; =20 -#define TYPE_LAN9118 "lan9118" #define LAN9118(obj) OBJECT_CHECK(lan9118_state, (obj), TYPE_LAN9118) =20 typedef struct { diff --git a/include/hw/net/lan9118.h b/include/hw/net/lan9118.h index 340d6681b7..2a3e2b0dea 100644 --- a/include/hw/net/lan9118.h +++ b/include/hw/net/lan9118.h @@ -16,6 +16,8 @@ #include "hw/irq.h" #include "net/net.h" =20 +#define TYPE_LAN9118 "lan9118" + void lan9118_init(NICInfo *, uint32_t, qemu_irq); =20 #endif --=20 2.17.2