From patchwork Thu Mar 31 20:56:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Ricard X-Patchwork-Id: 8719091 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 16B1EC0553 for ; Thu, 31 Mar 2016 23:04:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88D82202FF for ; Thu, 31 Mar 2016 23:04:49 +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 B3510201D3 for ; Thu, 31 Mar 2016 23:04:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1allds-0006yf-Nv; Thu, 31 Mar 2016 23:04:44 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1allds-0006yU-5h for tpmdd-devel@lists.sourceforge.net; Thu, 31 Mar 2016 23:04:44 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.68 as permitted sender) client-ip=74.125.82.68; envelope-from=christophe.ricard@gmail.com; helo=mail-wm0-f68.google.com; Received: from mail-wm0-f68.google.com ([74.125.82.68]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1alldq-0007nw-E7 for tpmdd-devel@lists.sourceforge.net; Thu, 31 Mar 2016 23:04:44 +0000 Received: by mail-wm0-f68.google.com with SMTP id p65so324125wmp.1 for ; Thu, 31 Mar 2016 16:04:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K1ENPt0eMZvcKYqNxa8/sotEMtD7Wykzr3bEQBP5fKo=; b=l3FT6sgr2m+rDH/kjk46LNdhRn3lZMAIEARkaAEiE2RMeB+ImMTs+BeLlXsZyJcWmT jSAEP3SaV6p3HqkvM1WN5i9+izDuEbHr4LL+XnyRSUYa/2DLR49Nwx6bU0IoKghtS03K gfLBdmrJ4zOoZYN1Dt04YUb6DzokAL13B0vrQx/hgiHJ9WX4ry0TRe/z4fTBRA+ySo8w egp2+zngeUrZ3bxhNycR/b0hG4OqHUyA3XIVPZ8g4I4Qm49UILIGZYB9m9pTjeE/HYF/ fMTh6a4S8d74ojQGBFH/S564LMTfyIt8lBeQ99yoL0a9nke4X6b68pxH99ZifNv3mCCz NOxw== X-Gm-Message-State: AD7BkJLn0UGKsSpnP8EqL3/DsRic7N7G1cRpOMtN+bZdbOzDXHAW6hutKNDgafFQ2+30/w== X-Received: by 10.28.179.7 with SMTP id c7mr1351643wmf.46.1459457829976; Thu, 31 Mar 2016 13:57:09 -0700 (PDT) Received: from localhost.localdomain (ax113-6-78-236-204-66.fbx.proxad.net. [78.236.204.66]) by smtp.gmail.com with ESMTPSA id 192sm11292516wmw.0.2016.03.31.13.57.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 13:57:09 -0700 (PDT) From: Christophe Ricard X-Google-Original-From: Christophe Ricard To: jarkko.sakkinen@linux.intel.com Date: Thu, 31 Mar 2016 22:56:58 +0200 Message-Id: <1459457820-30542-5-git-send-email-christophe-h.ricard@st.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459457820-30542-1-git-send-email-christophe-h.ricard@st.com> References: <1459457820-30542-1-git-send-email-christophe-h.ricard@st.com> X-Spam-Score: -1.6 (-) X-Headers-End: 1alldq-0007nw-E7 Cc: jean-luc.blanc@st.com, ashley@ashleylai.com, tpmdd-devel@lists.sourceforge.net, christophe-h.ricard@st.com, benoit.houyere@st.com Subject: [tpmdd-devel] [PATCH v4 4/6] tpm: drop 'locality' 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=-7.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,HK_RANDOM_ENVFROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 the field 'locality' from struct tpm_vendor_specific migrated it to the private structures of st33zp24, tpm_i2c_infineon and tpm_tis. Signed-off-by: Christophe Ricard Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/st33zp24/st33zp24.c | 12 +++--- drivers/char/tpm/st33zp24/st33zp24.h | 1 + drivers/char/tpm/tpm.h | 1 - drivers/char/tpm/tpm_i2c_infineon.c | 25 +++++++------ drivers/char/tpm/tpm_tis.c | 71 ++++++++++++++++++------------------ 5 files changed, 55 insertions(+), 55 deletions(-) diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c index d2e0175..3802c58 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.c +++ b/drivers/char/tpm/st33zp24/st33zp24.c @@ -136,7 +136,7 @@ static int check_locality(struct tpm_chip *chip) if (status && (data & (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) == (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) - return chip->vendor.locality; + return tpm_dev->locality; return -EACCES; } /* check_locality() */ @@ -153,11 +153,11 @@ static int request_locality(struct tpm_chip *chip) struct st33zp24_dev *tpm_dev; u8 data; - if (check_locality(chip) == chip->vendor.locality) - return chip->vendor.locality; - tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip); + if (check_locality(chip) == tpm_dev->locality) + return tpm_dev->locality; + data = TPM_ACCESS_REQUEST_USE; ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_ACCESS, &data, 1); if (ret < 0) @@ -168,7 +168,7 @@ static int request_locality(struct tpm_chip *chip) /* Request locality is usually effective after the request */ do { if (check_locality(chip) >= 0) - return chip->vendor.locality; + return tpm_dev->locality; msleep(TPM_TIMEOUT); } while (time_before(jiffies, stop)); @@ -566,7 +566,7 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops, chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT); chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT); - chip->vendor.locality = LOCALITY0; + tpm_dev->locality = LOCALITY0; if (irq) { /* INTERRUPT Setup */ diff --git a/drivers/char/tpm/st33zp24/st33zp24.h b/drivers/char/tpm/st33zp24/st33zp24.h index 9b5cdc7..6f4a419 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.h +++ b/drivers/char/tpm/st33zp24/st33zp24.h @@ -25,6 +25,7 @@ struct st33zp24_dev { struct tpm_chip *chip; void *phy_id; const struct st33zp24_phy_ops *ops; + int locality; int irq; u32 intrs; int io_lpcpd; diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 62e711b..68a40c6 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -131,7 +131,6 @@ enum tpm2_startup_types { struct tpm_chip; struct tpm_vendor_specific { - int locality; unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */ bool timeout_adjusted; unsigned long duration[3]; /* jiffies */ diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c index 093daf9..8318946 100644 --- a/drivers/char/tpm/tpm_i2c_infineon.c +++ b/drivers/char/tpm/tpm_i2c_infineon.c @@ -66,6 +66,7 @@ enum i2c_chip_type { /* Structure to store I2C TPM specific stuff */ struct tpm_inf_dev { struct i2c_client *client; + int locality; u8 buf[TPM_BUFSIZE + sizeof(u8)]; /* max. buffer size + addr */ struct tpm_chip *chip; enum i2c_chip_type chip_type; @@ -288,7 +289,7 @@ static int check_locality(struct tpm_chip *chip, int loc) if ((buf & (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) == (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) { - chip->vendor.locality = loc; + tpm_dev.locality = loc; return loc; } @@ -337,7 +338,7 @@ static u8 tpm_tis_i2c_status(struct tpm_chip *chip) u8 i = 0; do { - if (iic_tpm_read(TPM_STS(chip->vendor.locality), &buf, 1) < 0) + if (iic_tpm_read(TPM_STS(tpm_dev.locality), &buf, 1) < 0) return 0; i++; @@ -351,7 +352,7 @@ static void tpm_tis_i2c_ready(struct tpm_chip *chip) { /* this causes the current command to be aborted */ u8 buf = TPM_STS_COMMAND_READY; - iic_tpm_write_long(TPM_STS(chip->vendor.locality), &buf, 1); + iic_tpm_write_long(TPM_STS(tpm_dev.locality), &buf, 1); } static ssize_t get_burstcount(struct tpm_chip *chip) @@ -365,7 +366,7 @@ static ssize_t get_burstcount(struct tpm_chip *chip) stop = jiffies + chip->vendor.timeout_d; do { /* Note: STS is little endian */ - if (iic_tpm_read(TPM_STS(chip->vendor.locality)+1, buf, 3) < 0) + if (iic_tpm_read(TPM_STS(tpm_dev.locality)+1, buf, 3) < 0) burstcnt = 0; else burstcnt = (buf[2] << 16) + (buf[1] << 8) + buf[0]; @@ -419,7 +420,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count) if (burstcnt > (count - size)) burstcnt = count - size; - rc = iic_tpm_read(TPM_DATA_FIFO(chip->vendor.locality), + rc = iic_tpm_read(TPM_DATA_FIFO(tpm_dev.locality), &(buf[size]), burstcnt); if (rc == 0) size += burstcnt; @@ -477,7 +478,7 @@ out: * so we sleep rather than keeping the bus busy */ usleep_range(SLEEP_DURATION_RESET_LOW, SLEEP_DURATION_RESET_HI); - release_locality(chip, chip->vendor.locality, 0); + release_locality(chip, tpm_dev.locality, 0); return size; } @@ -516,7 +517,7 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len) if (burstcnt > (len - 1 - count)) burstcnt = len - 1 - count; - rc = iic_tpm_write(TPM_DATA_FIFO(chip->vendor.locality), + rc = iic_tpm_write(TPM_DATA_FIFO(tpm_dev.locality), &(buf[count]), burstcnt); if (rc == 0) count += burstcnt; @@ -539,7 +540,7 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len) } /* write last byte */ - iic_tpm_write(TPM_DATA_FIFO(chip->vendor.locality), &(buf[count]), 1); + iic_tpm_write(TPM_DATA_FIFO(tpm_dev.locality), &(buf[count]), 1); wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &status); if ((status & TPM_STS_DATA_EXPECT) != 0) { rc = -EIO; @@ -547,7 +548,7 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len) } /* go and do it */ - iic_tpm_write(TPM_STS(chip->vendor.locality), &sts, 1); + iic_tpm_write(TPM_STS(tpm_dev.locality), &sts, 1); return len; out_err: @@ -556,7 +557,7 @@ out_err: * so we sleep rather than keeping the bus busy */ usleep_range(SLEEP_DURATION_RESET_LOW, SLEEP_DURATION_RESET_HI); - release_locality(chip, chip->vendor.locality, 0); + release_locality(chip, tpm_dev.locality, 0); return rc; } @@ -623,7 +624,7 @@ static int tpm_tis_i2c_init(struct device *dev) return tpm_chip_register(chip); out_release: - release_locality(chip, chip->vendor.locality, 1); + release_locality(chip, tpm_dev.locality, 1); tpm_dev.client = NULL; out_err: return rc; @@ -695,7 +696,7 @@ static int tpm_tis_i2c_remove(struct i2c_client *client) struct tpm_chip *chip = tpm_dev.chip; tpm_chip_unregister(chip); - release_locality(chip, chip->vendor.locality, 1); + release_locality(chip, tpm_dev.locality, 1); tpm_dev.client = NULL; return 0; diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index c52cfe1..33e18c9 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -96,6 +96,7 @@ struct tpm_info { struct priv_data { void __iomem *iobase; u16 manufacturer_id; + int locality; int irq; bool irq_tested; wait_queue_head_t int_queue; @@ -149,7 +150,7 @@ static int check_locality(struct tpm_chip *chip, int l) if ((ioread8(priv->iobase + TPM_ACCESS(l)) & (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) == (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) - return chip->vendor.locality = l; + return priv->locality = l; return -1; } @@ -211,7 +212,7 @@ static u8 tpm_tis_status(struct tpm_chip *chip) struct priv_data *priv = chip->vendor.priv; return ioread8(priv->iobase + - TPM_STS(chip->vendor.locality)); + TPM_STS(priv->locality)); } static void tpm_tis_ready(struct tpm_chip *chip) @@ -220,7 +221,7 @@ static void tpm_tis_ready(struct tpm_chip *chip) /* this causes the current command to be aborted */ iowrite8(TPM_STS_COMMAND_READY, - priv->iobase + TPM_STS(chip->vendor.locality)); + priv->iobase + TPM_STS(priv->locality)); } static int get_burstcount(struct tpm_chip *chip) @@ -234,9 +235,9 @@ static int get_burstcount(struct tpm_chip *chip) stop = jiffies + chip->vendor.timeout_d; do { burstcnt = ioread8(priv->iobase + - TPM_STS(chip->vendor.locality) + 1); + TPM_STS(priv->locality) + 1); burstcnt += ioread8(priv->iobase + - TPM_STS(chip->vendor.locality) + + TPM_STS(priv->locality) + 2) << 8; if (burstcnt) return burstcnt; @@ -258,8 +259,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count) burstcnt = get_burstcount(chip); for (; burstcnt > 0 && size < count; burstcnt--) buf[size++] = ioread8(priv->iobase + - TPM_DATA_FIFO(chip->vendor. - locality)); + TPM_DATA_FIFO(priv->locality)); } return size; } @@ -307,7 +307,7 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count) out: tpm_tis_ready(chip); - release_locality(chip, chip->vendor.locality, 0); + release_locality(chip, priv->locality, 0); return size; } @@ -344,7 +344,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len) burstcnt = get_burstcount(chip); for (; burstcnt > 0 && count < len - 1; burstcnt--) { iowrite8(buf[count], priv->iobase + - TPM_DATA_FIFO(chip->vendor.locality)); + TPM_DATA_FIFO(priv->locality)); count++; } @@ -359,7 +359,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len) /* write last byte */ iowrite8(buf[count], - priv->iobase + TPM_DATA_FIFO(chip->vendor.locality)); + priv->iobase + TPM_DATA_FIFO(priv->locality)); wait_for_tpm_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &priv->int_queue, false); status = tpm_tis_status(chip); @@ -372,7 +372,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len) out_err: tpm_tis_ready(chip); - release_locality(chip, chip->vendor.locality, 0); + release_locality(chip, priv->locality, 0); return rc; } @@ -383,10 +383,10 @@ static void disable_interrupts(struct tpm_chip *chip) intmask = ioread32(priv->iobase + - TPM_INT_ENABLE(chip->vendor.locality)); + TPM_INT_ENABLE(priv->locality)); intmask &= ~TPM_GLOBAL_INT_ENABLE; iowrite32(intmask, - priv->iobase + TPM_INT_ENABLE(chip->vendor.locality)); + priv->iobase + TPM_INT_ENABLE(priv->locality)); devm_free_irq(&chip->dev, priv->irq, chip); priv->irq = 0; chip->flags &= ~TPM_CHIP_FLAG_IRQ; @@ -410,7 +410,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len) /* go and do it */ iowrite8(TPM_STS_GO, - priv->iobase + TPM_STS(chip->vendor.locality)); + priv->iobase + TPM_STS(priv->locality)); if (chip->flags & TPM_CHIP_FLAG_IRQ) { ordinal = be32_to_cpu(*((__be32 *) (buf + 6))); @@ -430,7 +430,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len) return len; out_err: tpm_tis_ready(chip); - release_locality(chip, chip->vendor.locality, 0); + release_locality(chip, priv->locality, 0); return rc; } @@ -516,7 +516,7 @@ static int probe_itpm(struct tpm_chip *chip) goto out; tpm_tis_ready(chip); - release_locality(chip, chip->vendor.locality, 0); + release_locality(chip, priv->locality, 0); itpm = true; @@ -530,7 +530,7 @@ static int probe_itpm(struct tpm_chip *chip) out: itpm = rem_itpm; tpm_tis_ready(chip); - release_locality(chip, chip->vendor.locality, 0); + release_locality(chip, priv->locality, 0); return rc; } @@ -569,7 +569,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id) int i; interrupt = ioread32(priv->iobase + - TPM_INT_STATUS(chip->vendor.locality)); + TPM_INT_STATUS(priv->locality)); if (interrupt == 0) return IRQ_NONE; @@ -589,8 +589,8 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id) /* Clear interrupts handled with TPM_EOI */ iowrite32(interrupt, priv->iobase + - TPM_INT_STATUS(chip->vendor.locality)); - ioread32(priv->iobase + TPM_INT_STATUS(chip->vendor.locality)); + TPM_INT_STATUS(priv->locality)); + ioread32(priv->iobase + TPM_INT_STATUS(priv->locality)); return IRQ_HANDLED; } @@ -613,18 +613,18 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, priv->irq = irq; original_int_vec = ioread8(priv->iobase + - TPM_INT_VECTOR(chip->vendor.locality)); + TPM_INT_VECTOR(priv->locality)); iowrite8(irq, - priv->iobase + TPM_INT_VECTOR(chip->vendor.locality)); + priv->iobase + TPM_INT_VECTOR(priv->locality)); /* Clear all existing */ iowrite32(ioread32(priv->iobase + - TPM_INT_STATUS(chip->vendor.locality)), - priv->iobase + TPM_INT_STATUS(chip->vendor.locality)); + TPM_INT_STATUS(priv->locality)), + priv->iobase + TPM_INT_STATUS(priv->locality)); /* Turn on */ iowrite32(intmask | TPM_GLOBAL_INT_ENABLE, - priv->iobase + TPM_INT_ENABLE(chip->vendor.locality)); + priv->iobase + TPM_INT_ENABLE(priv->locality)); priv->irq_tested = false; @@ -641,7 +641,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, */ if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) { iowrite8(original_int_vec, - priv->iobase + TPM_INT_VECTOR(chip->vendor.locality)); + priv->iobase + TPM_INT_VECTOR(priv->locality)); return 1; } @@ -659,7 +659,7 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask) int i; original_int_vec = ioread8(priv->iobase + - TPM_INT_VECTOR(chip->vendor.locality)); + TPM_INT_VECTOR(priv->locality)); if (!original_int_vec) { if (IS_ENABLED(CONFIG_X86)) @@ -679,14 +679,13 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts"); static void tpm_tis_remove(struct tpm_chip *chip) { struct priv_data *priv = chip->vendor.priv; - void __iomem *reg = priv->iobase + - TPM_INT_ENABLE(chip->vendor.locality); + void __iomem *reg = priv->iobase + TPM_INT_ENABLE(priv->locality); if (chip->flags & TPM_CHIP_FLAG_TPM2) tpm2_shutdown(chip, TPM2_SU_CLEAR); iowrite32(~TPM_GLOBAL_INT_ENABLE & ioread32(reg), reg); - release_locality(chip, chip->vendor.locality, 1); + release_locality(chip, priv->locality, 1); } static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, @@ -727,12 +726,12 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, /* Take control of the TPM's interrupt hardware and shut it off */ intmask = ioread32(priv->iobase + - TPM_INT_ENABLE(chip->vendor.locality)); + TPM_INT_ENABLE(priv->locality)); intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT; intmask &= ~TPM_GLOBAL_INT_ENABLE; iowrite32(intmask, - priv->iobase + TPM_INT_ENABLE(chip->vendor.locality)); + priv->iobase + TPM_INT_ENABLE(priv->locality)); if (request_locality(chip, 0) != 0) { rc = -ENODEV; @@ -766,7 +765,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, /* Figure out the capabilities */ intfcaps = ioread32(priv->iobase + - TPM_INTF_CAPS(chip->vendor.locality)); + TPM_INTF_CAPS(priv->locality)); dev_dbg(dev, "TPM interface capabilities (0x%x):\n", intfcaps); if (intfcaps & TPM_INTF_BURST_COUNT_STATIC) @@ -850,17 +849,17 @@ static void tpm_tis_reenable_interrupts(struct tpm_chip *chip) /* reenable interrupts that device may have lost or BIOS/firmware may have disabled */ iowrite8(priv->irq, priv->iobase + - TPM_INT_VECTOR(chip->vendor.locality)); + TPM_INT_VECTOR(priv->locality)); intmask = - ioread32(priv->iobase + TPM_INT_ENABLE(chip->vendor.locality)); + ioread32(priv->iobase + TPM_INT_ENABLE(priv->locality)); intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE; iowrite32(intmask, - priv->iobase + TPM_INT_ENABLE(chip->vendor.locality)); + priv->iobase + TPM_INT_ENABLE(priv->locality)); } static int tpm_tis_resume(struct device *dev)