]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.28/tmp-use-pdev-for-parent-device-in-tpm_chip_alloc.patch
Remove duplicated commits
[thirdparty/kernel/stable-queue.git] / releases / 4.9.28 / tmp-use-pdev-for-parent-device-in-tpm_chip_alloc.patch
CommitLineData
b74db2ac
GKH
1From 2998b02b2fb58f36ccbc318b00513174e9947d8e Mon Sep 17 00:00:00 2001
2From: "Winkler, Tomas" <tomas.winkler@intel.com>
3Date: Wed, 23 Nov 2016 12:04:13 +0200
4Subject: tmp: use pdev for parent device in tpm_chip_alloc
5
6From: Winkler, Tomas <tomas.winkler@intel.com>
7
8commit 2998b02b2fb58f36ccbc318b00513174e9947d8e upstream.
9
10The tpm stack uses pdev name convention for the parent device.
11Fix that also in tpm_chip_alloc().
12
13Fixes: 3897cd9c8d1d ("tpm: Split out the devm stuff from tpmm_chip_alloc")'
14Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
15Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
16Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
17Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/char/tpm/tpm-chip.c | 8 ++++----
22 1 file changed, 4 insertions(+), 4 deletions(-)
23
24--- a/drivers/char/tpm/tpm-chip.c
25+++ b/drivers/char/tpm/tpm-chip.c
26@@ -140,7 +140,7 @@ static void tpm_dev_release(struct devic
27 * Allocates a new struct tpm_chip instance and assigns a free
28 * device number for it. Must be paired with put_device(&chip->dev).
29 */
30-struct tpm_chip *tpm_chip_alloc(struct device *dev,
31+struct tpm_chip *tpm_chip_alloc(struct device *pdev,
32 const struct tpm_class_ops *ops)
33 {
34 struct tpm_chip *chip;
35@@ -159,7 +159,7 @@ struct tpm_chip *tpm_chip_alloc(struct d
36 rc = idr_alloc(&dev_nums_idr, NULL, 0, TPM_NUM_DEVICES, GFP_KERNEL);
37 mutex_unlock(&idr_lock);
38 if (rc < 0) {
39- dev_err(dev, "No available tpm device numbers\n");
40+ dev_err(pdev, "No available tpm device numbers\n");
41 kfree(chip);
42 return ERR_PTR(rc);
43 }
44@@ -169,7 +169,7 @@ struct tpm_chip *tpm_chip_alloc(struct d
45
46 chip->dev.class = tpm_class;
47 chip->dev.release = tpm_dev_release;
48- chip->dev.parent = dev;
49+ chip->dev.parent = pdev;
50 chip->dev.groups = chip->groups;
51
52 if (chip->dev_num == 0)
53@@ -181,7 +181,7 @@ struct tpm_chip *tpm_chip_alloc(struct d
54 if (rc)
55 goto out;
56
57- if (!dev)
58+ if (!pdev)
59 chip->flags |= TPM_CHIP_FLAG_VIRTUAL;
60
61 cdev_init(&chip->cdev, &tpm_fops);