From patchwork Thu Sep 18 09:32:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gonglei (Arei)" X-Patchwork-Id: 390712 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6E8B71401E7 for ; Thu, 18 Sep 2014 19:39:39 +1000 (EST) Received: from localhost ([::1]:49373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYBB-0007cG-9e for incoming@patchwork.ozlabs.org; Thu, 18 Sep 2014 05:39:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUY69-0007jX-MY for qemu-devel@nongnu.org; Thu, 18 Sep 2014 05:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUY60-0002FC-00 for qemu-devel@nongnu.org; Thu, 18 Sep 2014 05:33:55 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:2784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUY5z-0002CP-7C for qemu-devel@nongnu.org; Thu, 18 Sep 2014 05:33:47 -0400 Received: from 172.24.2.119 (EHLO szxeml410-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CBV56814; Thu, 18 Sep 2014 17:33:30 +0800 (CST) Received: from localhost (10.177.19.102) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.3.158.1; Thu, 18 Sep 2014 17:33:23 +0800 From: To: Date: Thu, 18 Sep 2014 17:32:59 +0800 Message-ID: <1411032780-10692-19-git-send-email-arei.gonglei@huawei.com> X-Mailer: git-send-email 1.7.3.1.msysgit.0 In-Reply-To: <1411032780-10692-1-git-send-email-arei.gonglei@huawei.com> References: <1411032780-10692-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.19.102] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.64 Cc: weidong.huang@huawei.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, armbru@redhat.com, Gonglei , kraxel@redhat.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 18/19] usb-mtp: convert init to realize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Gonglei Signed-off-by: Gonglei Reviewed-by: Paolo Bonzini --- hw/usb/dev-mtp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 0820046..108ece8 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1060,7 +1060,7 @@ static void usb_mtp_handle_data(USBDevice *dev, USBPacket *p) } } -static int usb_mtp_initfn(USBDevice *dev) +static void usb_mtp_realize(USBDevice *dev, Error **errp) { MTPState *s = DO_UPCAST(MTPState, dev, dev); @@ -1075,7 +1075,6 @@ static int usb_mtp_initfn(USBDevice *dev) s->desc = g_strdup("none"); } } - return 0; } static const VMStateDescription vmstate_usb_mtp = { @@ -1100,7 +1099,7 @@ static void usb_mtp_class_initfn(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); USBDeviceClass *uc = USB_DEVICE_CLASS(klass); - uc->init = usb_mtp_initfn; + uc->realize = usb_mtp_realize; uc->product_desc = "QEMU USB MTP"; uc->usb_desc = &desc; uc->cancel_packet = usb_mtp_cancel_packet;