From patchwork Thu Sep 2 13:37:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Kohl X-Patchwork-Id: 63490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 04E4FB7176 for ; Fri, 3 Sep 2010 00:25:47 +1000 (EST) Received: from localhost ([127.0.0.1]:36273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrAYN-0007B2-1V for incoming@patchwork.ozlabs.org; Thu, 02 Sep 2010 10:14:11 -0400 Received: from [140.186.70.92] (port=49877 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrAQj-0003ll-Ss for qemu-devel@nongnu.org; Thu, 02 Sep 2010 10:06:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Or9zB-0000v4-Il for qemu-devel@nongnu.org; Thu, 02 Sep 2010 09:37:50 -0400 Received: from demumfd002.nsn-inter.net ([93.183.12.31]:12992) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Or9zB-0000ud-76 for qemu-devel@nongnu.org; Thu, 02 Sep 2010 09:37:49 -0400 Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd002.nsn-inter.net (8.12.11.20060308/8.12.11) with ESMTP id o82DbiMM006763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Sep 2010 15:37:44 +0200 Received: from localhost6.localdomain6 ([10.148.23.89]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id o82Dbht7001364; Thu, 2 Sep 2010 15:37:43 +0200 From: Bernhard Kohl To: qemu-devel@nongnu.org Date: Thu, 2 Sep 2010 15:37:37 +0200 Message-Id: <1283434657-12843-1-git-send-email-bernhard.kohl@nsn.com> X-Mailer: git-send-email 1.7.2.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: kwolf@redhat.com, Bernhard Kohl Subject: [Qemu-devel] [PATCH] lsi53c895a: avoid calling a NULL function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In scsi-generic the reset() function is not available. Signed-off-by: Bernhard Kohl --- hw/lsi53c895a.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 5eaf69e..01ff028 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -1597,7 +1597,9 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val) for (id = 0; id < s->bus.ndev; id++) { if (s->bus.devs[id]) { dev = &s->bus.devs[id]->qdev; - dev->info->reset(dev); + if (dev->info->reset) { + dev->info->reset(dev); + } } } s->sstat0 |= LSI_SSTAT0_RST;