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: 72574 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp486534qga; Thu, 21 Jul 2016 07:56:58 -0700 (PDT) X-Received: by 10.55.184.198 with SMTP id i189mr71120818qkf.196.1469113018415; Thu, 21 Jul 2016 07:56:58 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x129si5226002qkd.159.2016.07.21.07.56.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Jul 2016 07:56:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:41326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFPF-0006T0-Rm for patch@linaro.org; Thu, 21 Jul 2016 10:56:57 -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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- hw/watchdog/wdt_ib700.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 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);