From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsHQ4-0006wP-Vz for qemu-devel@nongnu.org; Sun, 15 Dec 2013 14:32:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsHPv-0008Ee-Lv for qemu-devel@nongnu.org; Sun, 15 Dec 2013 14:32:04 -0500 Received: from cantor2.suse.de ([195.135.220.15]:53059 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsHPv-0008D3-Fp for qemu-devel@nongnu.org; Sun, 15 Dec 2013 14:31:55 -0500 Message-ID: <52AE03A6.1000903@suse.de> Date: Sun, 15 Dec 2013 20:31:50 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <87vbyqn4s3.fsf@moxielogic.com> <87situl1ou.fsf@moxielogic.com> In-Reply-To: <87situl1ou.fsf@moxielogic.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-moxie: Add moxie Marin SoC support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Green Cc: Peter Crosthwaite , Antony Pavlov , liguang , "qemu-devel@nongnu.org Developers" Am 15.12.2013 13:48, schrieb Anthony Green: > Peter Crosthwaite writes: >> On Sun, Dec 15, 2013 at 1:59 PM, Anthony Green = wrote: >>> diff --git a/hw/moxie/marin.c b/hw/moxie/marin.c >>> new file mode 100644 >>> index 0000000..0a998e4 >>> --- /dev/null >>> +++ b/hw/moxie/marin.c [...] >>> +static inline DeviceState *marin_uart_create(hwaddr base, >>> + qemu_irq irq) >>> +{ >>> + DeviceState *dev; >>> + >>> + dev =3D qdev_create(NULL, "marin-uart"); >>> + qdev_init_nofail(dev); >>> + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); >>> + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); >>> + >>> + return dev; >>> +} >> >> This is an old style qdev init function. >=20 > Any good pointers for a new style init function? What Peter C. probably meant here was it is a pre-qdev init function. Unless there is a strong need for reuse, just inline it into the machine init function to show that it is using pure QOM constructs. As for new-style init functions, since you are not setting any properties, chances are good that you can do in an instance_init function (rather than realize function) what you did in a deprecated SysBus init function IIRC. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg