From patchwork Wed Jun 29 09:58:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrew.zamansky@nuvoton.com X-Patchwork-Id: 641946 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rfdPP5rDTz9sxb for ; Wed, 29 Jun 2016 19:56:57 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bICEl-0007vO-Ma; Wed, 29 Jun 2016 09:56:51 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bICEk-0007vG-NB for tpmdd-devel@lists.sourceforge.net; Wed, 29 Jun 2016 09:56:50 +0000 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27] helo=herzl.nuvoton.co.il) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1bICEj-0007sS-Hw for tpmdd-devel@lists.sourceforge.net; Wed, 29 Jun 2016 09:56:50 +0000 Received: from talu02.nuvoton.co.il (ntil-fw [212.199.177.25]) by herzl.nuvoton.co.il (8.13.8/8.13.8) with ESMTP id u5T9hf7d025913; Wed, 29 Jun 2016 12:43:41 +0300 Received: from andrew-desktop.nuvoton.com (unknown [10.191.20.94]) by talu02.nuvoton.co.il (Postfix) with ESMTP id 81BD324FD9; Wed, 29 Jun 2016 12:56:39 +0300 (IDT) From: andrew zamansky To: jarkko.sakkinen@linux.intel.com, tpmdd-devel@lists.sourceforge.net Date: Wed, 29 Jun 2016 12:58:49 +0300 Message-Id: <1467194329-5543-3-git-send-email-andrew.zamansky@nuvoton.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467194329-5543-1-git-send-email-andrew.zamansky@nuvoton.com> References: <1467194329-5543-1-git-send-email-andrew.zamansky@nuvoton.com> X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 TVD_RCVD_IP Message was received from an IP address X-Headers-End: 1bICEj-0007sS-Hw Cc: andrew.zamansky@nuvoton.com, gcwilson@us.ibm.com, azamansk@nuvoton.com, Dan.Morav@nuvoton.com, stimpy1@gmail.com Subject: [tpmdd-devel] [PATCH 2/2] add irq validity check in tpm_i2c_nuvoton driver X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net if irq==0 (actualy invalid value) then error is printed to dmesg after trying to register to 0 interrupt Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_i2c_nuvoton.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c index 75a80e466..3081529 100644 --- a/drivers/char/tpm/tpm_i2c_nuvoton.c +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c @@ -554,7 +554,9 @@ static int i2c_nuvoton_probe(struct i2c_client *client, * TPM_INTF_INT_LEVEL_LOW | TPM_INTF_DATA_AVAIL_INT * The IRQ should be set in the i2c_board_info (which is done * automatically in of_i2c_register_devices, for device tree users */ - chip->flags |= TPM_CHIP_FLAG_IRQ; + if(chip->flags) + chip->flags |= TPM_CHIP_FLAG_IRQ; + priv->irq = client->irq; if (chip->flags & TPM_CHIP_FLAG_IRQ) {