From patchwork Wed Apr 13 19:55:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Ricard X-Patchwork-Id: 610204 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 3qlZLR6vzRz9sCY for ; Thu, 14 Apr 2016 05:56:15 +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 1aqQtX-0002Lz-A8; Wed, 13 Apr 2016 19:56:11 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1aqQtW-0002Ln-4G for tpmdd-devel@lists.sourceforge.net; Wed, 13 Apr 2016 19:56:10 +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 1aqQtU-0003l3-Nh for tpmdd-devel@lists.sourceforge.net; Wed, 13 Apr 2016 19:56:10 +0000 Received: by mail-wm0-f68.google.com with SMTP id l6so17007755wml.3 for ; Wed, 13 Apr 2016 12:56:08 -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=sfqx4oxspGKNzCgDYUSYPXD3FiVG1a9E7I+Gt9rJrwQ=; b=MJC+MtaRGCgLeFmXD8uSB0WbIEfwahdkRa3TE12WGyyAbAX3r4/RM2ZaXbNpMf30IU Y2PBdo9F/YWZ6cpBCK3j3bsdNh+qNgviWWRU4y9KO+cQK41RLmLjXOGoIk2dE5dCyNxW 5ZaTqsyz4Wmk3CGDidaCziq4zNl13Elnv3zHOPcvDKa0BtZfItKTCC6+fdOwNECvH+oB oDhr9Tzx6l1v1k9b7o28hRxPgHmnX2KkSEsbu0WZcpNf32xMrHcZXLlnhd45quh4SL+O Fqn8EQ/mCc6lCx4rQW4tNkJeAZzgclWg1ndF7zeOoDBncH2yXQPO5atOkH3sGwDVQMhR 7lQQ== X-Gm-Message-State: AD7BkJLLEaH59T1tg6bJJGl0RnjvPkjoi6JB/YdOvPSv+sgk7iY2cOj8UB9QCfrQfMBgLQ== X-Received: by 10.28.92.13 with SMTP id q13mr31535503wmb.43.1460577362717; Wed, 13 Apr 2016 12:56:02 -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 202sm10488911wmw.5.2016.04.13.12.56.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Apr 2016 12:56:01 -0700 (PDT) From: Christophe Ricard X-Google-Original-From: Christophe Ricard To: jarkko.sakkinen@linux.intel.com Date: Wed, 13 Apr 2016 21:55:41 +0200 Message-Id: <1460577351-24632-3-git-send-email-christophe-h.ricard@st.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460577351-24632-1-git-send-email-christophe-h.ricard@st.com> References: <1460577351-24632-1-git-send-email-christophe-h.ricard@st.com> X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (christophe.ricard[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1aqQtU-0003l3-Nh 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 v2 02/12] tpm: tpm_tis: Rename priv_data structure tpm_tis_data 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 For code sanity rename priv_data tpm_tis_data. Signed-off-by: Christophe Ricard --- drivers/char/tpm/tpm_tis.c | 46 ++++++++++++++++++++--------------------- drivers/char/tpm/tpm_tis_core.h | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index cc64edb..3b84ade 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -126,7 +126,7 @@ static inline int is_itpm(struct acpi_device *dev) * correct values in the other bits.' */ static int wait_startup(struct tpm_chip *chip, int l) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; unsigned long stop = jiffies + chip->timeout_a; do { @@ -140,7 +140,7 @@ static int wait_startup(struct tpm_chip *chip, int l) static int check_locality(struct tpm_chip *chip, int l) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; if ((ioread8(priv->iobase + TPM_ACCESS(l)) & @@ -153,7 +153,7 @@ static int check_locality(struct tpm_chip *chip, int l) static void release_locality(struct tpm_chip *chip, int l, int force) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; if (force || (ioread8(priv->iobase + TPM_ACCESS(l)) & @@ -165,7 +165,7 @@ static void release_locality(struct tpm_chip *chip, int l, int force) static int request_locality(struct tpm_chip *chip, int l) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; unsigned long stop, timeout; long rc; @@ -207,7 +207,7 @@ again: static u8 tpm_tis_status(struct tpm_chip *chip) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; return ioread8(priv->iobase + @@ -216,7 +216,7 @@ static u8 tpm_tis_status(struct tpm_chip *chip) static void tpm_tis_ready(struct tpm_chip *chip) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; /* this causes the current command to be aborted */ @@ -226,7 +226,7 @@ static void tpm_tis_ready(struct tpm_chip *chip) static int get_burstcount(struct tpm_chip *chip) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; unsigned long stop; int burstcnt; @@ -249,7 +249,7 @@ static int get_burstcount(struct tpm_chip *chip) static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; int size = 0, burstcnt; while (size < count && @@ -268,7 +268,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count) static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); int size = 0; int expected, status; @@ -324,7 +324,7 @@ MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)"); */ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; int rc, status, burstcnt; size_t count = 0; @@ -381,7 +381,7 @@ out_err: static void disable_interrupts(struct tpm_chip *chip) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; u32 intmask; @@ -403,7 +403,7 @@ static void disable_interrupts(struct tpm_chip *chip) */ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); int rc; u32 ordinal; unsigned long dur; @@ -441,7 +441,7 @@ out_err: static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len) { int rc, irq; - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); if (!(chip->flags & TPM_CHIP_FLAG_IRQ) || priv->irq_tested) return tpm_tis_send_main(chip, buf, len); @@ -475,7 +475,7 @@ static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = { static bool tpm_tis_update_timeouts(struct tpm_chip *chip, unsigned long *timeout_cap) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; int i; u32 did_vid; @@ -500,7 +500,7 @@ static bool tpm_tis_update_timeouts(struct tpm_chip *chip, */ static int probe_itpm(struct tpm_chip *chip) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; int rc = 0; u8 cmd_getticks[] = { @@ -543,7 +543,7 @@ out: static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); switch (priv->manufacturer_id) { case TPM_VID_WINBOND: @@ -570,7 +570,7 @@ static const struct tpm_class_ops tpm_tis = { static irqreturn_t tis_int_handler(int dummy, void *dev_id) { struct tpm_chip *chip = dev_id; - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; u32 interrupt; int i; @@ -608,7 +608,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id) static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, int flags, int irq) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; u8 original_int_vec; @@ -662,7 +662,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, */ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; u8 original_int_vec; int i; @@ -687,7 +687,7 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts"); static void tpm_tis_remove(struct tpm_chip *chip) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); struct tpm_tis_phy *phy = priv->phy_id; void __iomem *reg = priv->iobase + TPM_INT_ENABLE(priv->locality); @@ -704,10 +704,10 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, u32 vendor, intfcaps, intmask; int rc, probe; struct tpm_chip *chip; - struct priv_data *priv; + struct tpm_tis_data *priv; struct tpm_tis_phy *phy; - priv = devm_kzalloc(dev, sizeof(struct priv_data), GFP_KERNEL); + priv = devm_kzalloc(dev, sizeof(struct tpm_tis_data), GFP_KERNEL); if (priv == NULL) return -ENOMEM; @@ -860,7 +860,7 @@ out_err: #ifdef CONFIG_PM_SLEEP static void tpm_tis_reenable_interrupts(struct tpm_chip *chip) { - struct priv_data *priv = dev_get_drvdata(&chip->dev); + struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); u32 intmask; /* reenable interrupts that device may have lost or diff --git a/drivers/char/tpm/tpm_tis_core.h b/drivers/char/tpm/tpm_tis_core.h index b28ed00..20f50e5 100644 --- a/drivers/char/tpm/tpm_tis_core.h +++ b/drivers/char/tpm/tpm_tis_core.h @@ -25,7 +25,7 @@ #include "tpm.h" -struct priv_data { +struct tpm_tis_data { u16 manufacturer_id; int locality; int irq;