summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm-dev.c
diff options
context:
space:
mode:
authorTadeusz Struk <tadeusz.struk@intel.com>2018-09-10 20:18:28 +0300
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2018-10-05 13:47:33 +0300
commitc3d477a725ef6b3d17609d5dafc644cccc070cb9 (patch)
tree055f6c7df57171b6d79e2d6e8891e01361885f80 /drivers/char/tpm/tpm-dev.c
parent2f7d8dbb11287cbe9da6380ca14ed5d38c9ed91f (diff)
downloadlinux-c3d477a725ef6b3d17609d5dafc644cccc070cb9.tar.xz
tpm: add ptr to the tpm_space struct to file_priv
Add a ptr to struct tpm_space to the file_priv and consolidate of the write operations for the two interfaces. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Tested-by: Philip Tricca <philip.b.tricca@intel.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off--by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm/tpm-dev.c')
-rw-r--r--drivers/char/tpm/tpm-dev.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/char/tpm/tpm-dev.c b/drivers/char/tpm/tpm-dev.c
index ebd74ab5abef..98b9630c3a36 100644
--- a/drivers/char/tpm/tpm-dev.c
+++ b/drivers/char/tpm/tpm-dev.c
@@ -39,7 +39,7 @@ static int tpm_open(struct inode *inode, struct file *file)
if (priv == NULL)
goto out;
- tpm_common_open(file, chip, priv);
+ tpm_common_open(file, chip, priv, NULL);
return 0;
@@ -48,12 +48,6 @@ static int tpm_open(struct inode *inode, struct file *file)
return -ENOMEM;
}
-static ssize_t tpm_write(struct file *file, const char __user *buf,
- size_t size, loff_t *off)
-{
- return tpm_common_write(file, buf, size, off, NULL);
-}
-
/*
* Called on file close
*/
@@ -73,6 +67,6 @@ const struct file_operations tpm_fops = {
.llseek = no_llseek,
.open = tpm_open,
.read = tpm_common_read,
- .write = tpm_write,
+ .write = tpm_common_write,
.release = tpm_release,
};