From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: tpmdd-devel@lists.sourceforge.net,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] tmp: use pdev for parent device in tpm_chip_alloc
Date: Sat, 3 Dec 2016 17:35:30 +0200 [thread overview]
Message-ID: <20161203153530.yk3ilrg74qwg2f7a@intel.com> (raw)
In-Reply-To: <1479895454-15076-4-git-send-email-tomas.winkler@intel.com>
On Wed, Nov 23, 2016 at 12:04:13PM +0200, Tomas Winkler wrote:
> The tpm stack uses pdev name convention for the parent device.
> Fix that also in tpm_chip_alloc().
Usually I'm not too fond for minor style fixes but in this case it
improves the clarity.
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
/Jarkko
>
> Fixes: 3897cd9c8d1d ("tpm: Split out the devm stuff from tpmm_chip_alloc")'
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
> V2: 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 7a4869151d3b..eefdc809faf0 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
>
next prev parent reply other threads:[~2016-12-03 15:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 10:04 [PATCH v2 0/4] tpm: kdoc cleanup Tomas Winkler
2016-11-23 10:04 ` [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Tomas Winkler
2016-12-03 15:32 ` Jarkko Sakkinen
2016-12-03 16:15 ` Jarkko Sakkinen
2016-12-06 9:16 ` [tpmdd-devel] " Nayna
2016-12-06 12:11 ` Winkler, Tomas
2016-11-23 10:04 ` [PATCH v2 2/4] tpm/tpm2-chip: fix kdoc errors Tomas Winkler
2016-12-03 15:34 ` Jarkko Sakkinen
2016-12-03 16:16 ` Jarkko Sakkinen
2016-11-23 10:04 ` [PATCH v2 3/4] tmp: use pdev for parent device in tpm_chip_alloc Tomas Winkler
2016-12-03 15:35 ` Jarkko Sakkinen [this message]
2016-12-03 16:16 ` Jarkko Sakkinen
2016-11-23 10:04 ` [PATCH v2 4/4] tpm/vtpm: fix kdoc warnings Tomas Winkler
2016-12-03 15:36 ` Jarkko Sakkinen
2016-12-03 16:17 ` Jarkko Sakkinen
2016-11-23 15:59 ` [PATCH v2 0/4] tpm: kdoc cleanup Jarkko Sakkinen
2016-11-24 13:19 ` Jarkko Sakkinen
2016-12-03 16:19 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161203153530.yk3ilrg74qwg2f7a@intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tomas.winkler@intel.com \
--cc=tpmdd-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).