From patchwork Thu Jul 21 14:44:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 9241829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2A37D607D3 for ; Thu, 21 Jul 2016 14:55:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CBE927DE0 for ; Thu, 21 Jul 2016 14:55:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F2F527EE2; Thu, 21 Jul 2016 14:55:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8D89227DE0 for ; Thu, 21 Jul 2016 14:55:11 +0000 (UTC) Received: from localhost ([::1]:41313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFNU-0005Hy-IE for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Jul 2016 10:55:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFDf-0005er-VR for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:45:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQFDe-0007E4-3M for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:44:58 -0400 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:33005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFDd-0007Du-V2 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:44:58 -0400 Received: by mail-oi0-x241.google.com with SMTP id l9so7890973oih.0 for ; Thu, 21 Jul 2016 07:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R85fgNtbKDTg1TTzpTNHgxMGJg/K5zuBU91nUn78jNg=; b=Mgj0ZNZ8rgJgEkVI1g7v25SxwO+InL0FeDPEXF633VcZJi013RbMjg2LV7uky1M8bz B2Aft/hsqfnh5wQ/8bRiG/zvlDm9EFGd3S2njsH87f5wh0ubP/+fnCus60VaHhMl5UaD ZGuWbVesyxshAVj6C9zXINwDnLz7p8WEc9gD6be1e/jMbEf+7Qsz7gLMQkdBoM1tI+g7 7fhMHU1j7NzklzdgFMmdD5lG0NZo+wxTLx2Dlf6LIS9TPaL7R8SzC1+3Q12wTfOeUK9e Oycuc6OztMvh/7f+6orz3XKYC7SlUocrn9p6mBG2zil24s+MD3cmNSGnAPH6/0EXNYDP QZDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R85fgNtbKDTg1TTzpTNHgxMGJg/K5zuBU91nUn78jNg=; b=gBajsl/kRTVdLDIwv07Hvpt17g1ixahTPkPslonOXDFtXEZ3UZqO2Ro6Kgb0koE42/ L5wK463aq6wagVfesRxFdonsBrnLdmjVUwJ8C/djaOOVvn96+rH+EzYitLv4SGKd39p0 botozSnxApWiKGexbRDOCEX4n6DgFO69hRvPx7EE6f1Tbt/0DM0MvwLP+dmx2KUCSqzq C04PbTRsQQj94NdQx+efE1kAuqi3ft++G86DonanxYoU412pn/xHB/lRU3TN7kpW/a70 JykYp2zNB013qM3o1U6O0Awhlv32am9vt+WQEa/asOh/25r7025c2rLA5VsHxcKW6n5F TBww== X-Gm-Message-State: ALyK8tKELUJP/3pXbCbSFll3En4hwcd3IdVYTBos9GGYFX3kmABhM0zbbjP8eIGSwI9mpg== X-Received: by 10.202.244.206 with SMTP id s197mr11784014oih.84.1469112297457; Thu, 21 Jul 2016 07:44:57 -0700 (PDT) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id n39sm3304772otn.10.2016.07.21.07.44.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 07:44:56 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:f99a:ce1d:5fd3:dd9]) by serve.minyard.net (Postfix) with ESMTPA id 5E9161089; Thu, 21 Jul 2016 09:44:55 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 1FFB8300537; Thu, 21 Jul 2016 09:44:53 -0500 (CDT) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Thu, 21 Jul 2016 09:44:52 -0500 Message-Id: <1469112292-30548-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469112292-30548-1-git-send-email-minyard@acm.org> References: <1469112292-30548-1-git-send-email-minyard@acm.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::241 Subject: [Qemu-devel] [PATCH 3/3] wdt_ib700: Free timer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Richard W . M . Jones" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Corey Minyard Add an unrealize function to free the timer allocated in the realize function. Signed-off-by: Corey Minyard Cc: Richard W.M. Jones Cc: Marc-André Lureau Reviewed-by: Richard W.M. Jones --- hw/watchdog/wdt_ib700.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c index 532afe8..179771a 100644 --- a/hw/watchdog/wdt_ib700.c +++ b/hw/watchdog/wdt_ib700.c @@ -117,6 +117,14 @@ static void wdt_ib700_realize(DeviceState *dev, Error **errp) portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj), 0); } +static void wdt_ib700_unrealize(DeviceState *dev, Error **errp) +{ + IB700State *s = IB700(dev); + + timer_del(s->timer); + timer_free(s->timer); +} + static void wdt_ib700_reset(DeviceState *dev) { IB700State *s = IB700(dev); @@ -136,6 +144,7 @@ static void wdt_ib700_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = wdt_ib700_realize; + dc->unrealize = wdt_ib700_unrealize; dc->reset = wdt_ib700_reset; dc->vmsd = &vmstate_ib700; set_bit(DEVICE_CATEGORY_MISC, dc->categories);