Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1523634

[PATCH 3/4 v2] tmp: use pdev for parent device in tpm_chip_alloc

From Tomas Winkler <tomas.winkler@intel.com>
Newsgroups linux.kernel
Subject [PATCH 3/4 v2] tmp: use pdev for parent device in tpm_chip_alloc
Date 2016-11-16 17:10 +0100
Message-ID <sEaWC-56K-29@gated-at.bofh.it> (permalink)
References <sEaWB-56K-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The tpm stack uses pdev name convention for the parent device.
Fix that also in tpm_chip_alloc().

Fixes: 3897cd9c8d1d ("tpm: Split out the devm stuff from tpmm_chip_alloc")'
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
Resend.
 drivers/char/tpm/tpm-chip.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 3f27753d96aa..9e36a7f21a6e 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -141,7 +141,7 @@ static void tpm_dev_release(struct device *dev)
  * Allocates a new struct tpm_chip instance and assigns a free
  * device number for it. Must be paired with put_device(&chip->dev).
  */
-struct tpm_chip *tpm_chip_alloc(struct device *dev,
+struct tpm_chip *tpm_chip_alloc(struct device *pdev,
 				const struct tpm_class_ops *ops)
 {
 	struct tpm_chip *chip;
@@ -160,7 +160,7 @@ struct tpm_chip *tpm_chip_alloc(struct device *dev,
 	rc = idr_alloc(&dev_nums_idr, NULL, 0, TPM_NUM_DEVICES, GFP_KERNEL);
 	mutex_unlock(&idr_lock);
 	if (rc < 0) {
-		dev_err(dev, "No available tpm device numbers\n");
+		dev_err(pdev, "No available tpm device numbers\n");
 		kfree(chip);
 		return ERR_PTR(rc);
 	}
@@ -170,7 +170,7 @@ struct tpm_chip *tpm_chip_alloc(struct device *dev,
 
 	chip->dev.class = tpm_class;
 	chip->dev.release = tpm_dev_release;
-	chip->dev.parent = dev;
+	chip->dev.parent = pdev;
 	chip->dev.groups = chip->groups;
 
 	if (chip->dev_num == 0)
@@ -182,7 +182,7 @@ struct tpm_chip *tpm_chip_alloc(struct device *dev,
 	if (rc)
 		goto out;
 
-	if (!dev)
+	if (!pdev)
 		chip->flags |= TPM_CHIP_FLAG_VIRTUAL;
 
 	cdev_init(&chip->cdev, &tpm_fops);
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Tomas Winkler <tomas.winkler@intel.com> - 2016-11-16 17:10 +0100
  [PATCH 3/4 v2] tmp: use pdev for parent device in tpm_chip_alloc Tomas Winkler <tomas.winkler@intel.com> - 2016-11-16 17:10 +0100
    Re: [PATCH 3/4 v2] tmp: use pdev for parent device in tpm_chip_alloc Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-11-24 14:20 +0100
  [PATCH 4/4] tpm/vtpm: fix kdoc warnings Tomas Winkler <tomas.winkler@intel.com> - 2016-11-16 17:10 +0100
  Re: [PATCH 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-11-17 00:10 +0100
    RE: [PATCH 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd "Winkler, Tomas" <tomas.winkler@intel.com> - 2016-11-22 10:50 +0100
      Re: [PATCH 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-11-22 11:20 +0100
  Re: [PATCH 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-11-24 14:20 +0100

csiph-web