]>
Commit | Line | Data |
---|---|---|
b74db2ac GKH |
1 | From 2998b02b2fb58f36ccbc318b00513174e9947d8e Mon Sep 17 00:00:00 2001 |
2 | From: "Winkler, Tomas" <tomas.winkler@intel.com> | |
3 | Date: Wed, 23 Nov 2016 12:04:13 +0200 | |
4 | Subject: tmp: use pdev for parent device in tpm_chip_alloc | |
5 | ||
6 | From: Winkler, Tomas <tomas.winkler@intel.com> | |
7 | ||
8 | commit 2998b02b2fb58f36ccbc318b00513174e9947d8e upstream. | |
9 | ||
10 | The tpm stack uses pdev name convention for the parent device. | |
11 | Fix that also in tpm_chip_alloc(). | |
12 | ||
13 | Fixes: 3897cd9c8d1d ("tpm: Split out the devm stuff from tpmm_chip_alloc")' | |
14 | Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> | |
15 | Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | |
16 | Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | |
17 | Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | |
18 | Signed-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); |