From patchwork Wed Mar 23 05:31:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 8647131 Return-Path: X-Original-To: patchwork-tpmdd-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1351AC0553 for ; Wed, 23 Mar 2016 05:32:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2156B20364 for ; Wed, 23 Mar 2016 05:32:28 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 23F6B2035E for ; Wed, 23 Mar 2016 05:32:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1aibP6-0000j5-T9; Wed, 23 Mar 2016 05:32:24 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1aibP4-0000j0-Sh for tpmdd-devel@lists.sourceforge.net; Wed, 23 Mar 2016 05:32:22 +0000 X-ACL-Warn: Received: from mga04.intel.com ([192.55.52.120]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1aibP3-0007XV-UY for tpmdd-devel@lists.sourceforge.net; Wed, 23 Mar 2016 05:32:22 +0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 22 Mar 2016 22:32:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,381,1455004800"; d="scan'208";a="674209161" Received: from jkotka-mobl4.ger.corp.intel.com (HELO localhost) ([10.252.7.242]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2016 22:32:13 -0700 From: Jarkko Sakkinen To: Peter Huewe Date: Wed, 23 Mar 2016 07:31:56 +0200 Message-Id: <1458711116-15898-1-git-send-email-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.7.3 X-Spam-Score: -0.0 (/) X-Headers-End: 1aibP3-0007XV-UY Cc: "moderated list:TPM DEVICE DRIVER" , open list Subject: [tpmdd-devel] [PATCH] tpm_tis: drop manufacturer_id from struct tpm_vendor_specific 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-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, HK_RANDOM_ENVFROM, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Dropped manufacturer_id from struct tpm_vendor_specific and redeclared it in the private struct priv_data that tpm_tis uses because the field is only used tpm_tis. Signed-off-by: Jarkko Sakkinen Reviewed-by: Jason Gunthorpe --- drivers/char/tpm/tpm.h | 2 -- drivers/char/tpm/tpm_tis.c | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index cbab4e9..fcd7f1e 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -145,8 +145,6 @@ struct tpm_vendor_specific { void *priv; wait_queue_head_t read_queue; - - u16 manufacturer_id; }; #define TPM_VPRIV(c) ((c)->vendor.priv) diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 7d7a776..068f021 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -94,6 +94,7 @@ struct tpm_info { #define TPM_RID(l) (0x0F04 | ((l) << 12)) struct priv_data { + u16 manufacturer_id; bool irq_tested; wait_queue_head_t int_queue; }; @@ -516,7 +517,9 @@ out: static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status) { - switch (chip->vendor.manufacturer_id) { + struct priv_data *priv = chip->vendor.priv; + + switch (priv->manufacturer_id) { case TPM_VID_WINBOND: return ((status == TPM_STS_VALID) || (status == (TPM_STS_VALID | TPM_STS_COMMAND_READY))); @@ -722,7 +725,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, goto out_err; vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); - chip->vendor.manufacturer_id = vendor; + priv->manufacturer_id = vendor; dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n", (chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",