From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: Meng.Li-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] tpm: Add sysfs interface to show TPM family version
Date: Mon, 13 Mar 2017 11:46:11 -0700 [thread overview]
Message-ID: <1489430771.23810.5.camel@HansenPartnership.com> (raw)
In-Reply-To: <1489396817-24855-1-git-send-email-Meng.Li-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
On Mon, 2017-03-13 at 17:20 +0800, Meng.Li-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org wrote:
[...]
> +/**
> + * tpm_create_sysfs - Create tpm sysfs interface.
> + * @dev: pointer to tpm chip device
> + *
> + * Create sysfs interface for checking current TPM hardware version.
> + */
> +static int tpm_create_sysfs(struct device *dev)
> +{
> + int r, t;
> +
> + for (t = 0; t < ARRAY_SIZE(tpm_attrs); t++) {
> + r = device_create_file(dev, &tpm_attrs[t]);
> + if (r) {
> + dev_err(dev, "failed to create sysfs
> file\n");
> + return r;
> + }
> + }
> +
> + return 0;
> +}
> +
> +/**
> + * tpm_remove_sysfs - Remove tpm sysfs interface.
> + * @dev: pointer to tpm chip device
> + *
> + * Remove sysfs interface for checking current TPM hardware version.
> + */
> +static void tpm_remove_sysfs(struct device *dev)
> +{
> + int t;
> +
> + for (t = 0; t < ARRAY_SIZE(tpm_attrs); t++) {
> + device_remove_file(dev, &tpm_attrs[t]);
> + }
> +}
> +
For non-dynamic attributes, use the attribute_group structure in the
device instead. It will take care of creation and removal
automatically.
James
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Meng.Li@windriver.com, linux-kernel@vger.kernel.org
Cc: tpmdd-devel@lists.sourceforge.net
Subject: Re: [tpmdd-devel] [PATCH] tpm: Add sysfs interface to show TPM family version
Date: Mon, 13 Mar 2017 11:46:11 -0700 [thread overview]
Message-ID: <1489430771.23810.5.camel@HansenPartnership.com> (raw)
In-Reply-To: <1489396817-24855-1-git-send-email-Meng.Li@windriver.com>
On Mon, 2017-03-13 at 17:20 +0800, Meng.Li@windriver.com wrote:
[...]
> +/**
> + * tpm_create_sysfs - Create tpm sysfs interface.
> + * @dev: pointer to tpm chip device
> + *
> + * Create sysfs interface for checking current TPM hardware version.
> + */
> +static int tpm_create_sysfs(struct device *dev)
> +{
> + int r, t;
> +
> + for (t = 0; t < ARRAY_SIZE(tpm_attrs); t++) {
> + r = device_create_file(dev, &tpm_attrs[t]);
> + if (r) {
> + dev_err(dev, "failed to create sysfs
> file\n");
> + return r;
> + }
> + }
> +
> + return 0;
> +}
> +
> +/**
> + * tpm_remove_sysfs - Remove tpm sysfs interface.
> + * @dev: pointer to tpm chip device
> + *
> + * Remove sysfs interface for checking current TPM hardware version.
> + */
> +static void tpm_remove_sysfs(struct device *dev)
> +{
> + int t;
> +
> + for (t = 0; t < ARRAY_SIZE(tpm_attrs); t++) {
> + device_remove_file(dev, &tpm_attrs[t]);
> + }
> +}
> +
For non-dynamic attributes, use the attribute_group structure in the
device instead. It will take care of creation and removal
automatically.
James
next prev parent reply other threads:[~2017-03-13 18:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-13 9:20 [PATCH] tpm: Add sysfs interface to show TPM family version Meng.Li-CWA4WttNNZF54TAoqtyWWQ
2017-03-13 9:20 ` Meng.Li
[not found] ` <1489396817-24855-1-git-send-email-Meng.Li-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2017-03-13 11:54 ` Jarkko Sakkinen
2017-03-13 11:54 ` Jarkko Sakkinen
[not found] ` <20170313115415.2czyr4woaq4h3ncr-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-13 12:54 ` Li, Meng
2017-03-13 12:54 ` Li, Meng
[not found] ` <529F9A9100AE8045A7A5B5A00A39FBB83DE9325F-/c0cZIGrDsgyzarUywkIaosyD1qQU09I@public.gmane.org>
2017-03-13 14:31 ` Andrew Lunn
2017-03-13 14:31 ` [tpmdd-devel] " Andrew Lunn
2017-03-13 14:59 ` Jarkko Sakkinen
2017-03-13 14:59 ` Jarkko Sakkinen
[not found] ` <20170313145958.zoh2fdxnh3ytyr2z-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-13 16:55 ` Jason Gunthorpe
2017-03-13 16:55 ` Jason Gunthorpe
[not found] ` <20170313165547.GB25664-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-03-13 18:35 ` Jarkko Sakkinen
2017-03-13 18:35 ` Jarkko Sakkinen
2017-03-13 18:46 ` James Bottomley [this message]
2017-03-13 18:46 ` [tpmdd-devel] " James Bottomley
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=1489430771.23810.5.camel@HansenPartnership.com \
--to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
--cc=Meng.Li-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.