From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axy6w-0000lI-5i for qemu-devel@nongnu.org; Wed, 04 May 2016 10:49:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axy6k-0006yI-IX for qemu-devel@nongnu.org; Wed, 04 May 2016 10:49:04 -0400 Received: from mail-yw0-x231.google.com ([2607:f8b0:4002:c05::231]:36084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axy6j-0006q7-BK for qemu-devel@nongnu.org; Wed, 04 May 2016 10:48:58 -0400 Received: by mail-yw0-x231.google.com with SMTP id o66so95775945ywc.3 for ; Wed, 04 May 2016 07:48:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1459332586-13693-4-git-send-email-zxq_yx_007@163.com> References: <1459332586-13693-1-git-send-email-zxq_yx_007@163.com> <1459332586-13693-4-git-send-email-zxq_yx_007@163.com> From: Peter Maydell Date: Wed, 4 May 2016 15:48:15 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 9/9] hw/intc: QOM'ify omap_intc.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xiaoqiang zhao Cc: QEMU Developers , "Edgar E. Iglesias" , Igor Mitsyanko , Fabien Chouteau , Peter Chubb , Michael Walle On 30 March 2016 at 11:09, xiaoqiang zhao wrote: > * Split the old SysBus init into an instance_init and a > DeviceClass::realize function > * Drop the old SysBus init function and use instance_init > > Signed-off-by: xiaoqiang zhao > +static void omap_intc_realize(DeviceState *dev, Error **errp) > +{ > + struct omap_intr_handler_s *s = OMAP_INTC(dev); > + > + if (!s->iclk) { > + error_report("omap-intc: clk not connected"); > + } In a realize function we have an Error**, so we should use error_setg() to return this error, rather than calling error_report(). > +static void omap2_intc_realize(DeviceState *dev, Error **errp) > +{ > + struct omap_intr_handler_s *s = OMAP_INTC(dev); > + > + if (!s->iclk) { > + error_report("omap2-intc: iclk not connected"); > + return; > + } > + if (!s->fclk) { > + error_report("omap2-intc: fclk not connected"); > + return; > + } > } Similarly here. thanks -- PMM