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: 9204667 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 E89C560757 for ; Wed, 29 Jun 2016 09:56:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D82CE28497 for ; Wed, 29 Jun 2016 09:56:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD04D2864C; Wed, 29 Jun 2016 09:56:54 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E2BF628497 for ; Wed, 29 Jun 2016 09:56:53 +0000 (UTC) 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-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 X-Virus-Scanned: ClamAV using ClamSMTP 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) {