summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpmrm-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/tpmrm-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/tpmrm-dev.c')
-rw-r--r--drivers/char/tpm/tpmrm-dev.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/char/tpm/tpmrm-dev.c b/drivers/char/tpm/tpmrm-dev.c
index 1a0e97a5da5a..96006c6b9696 100644
--- a/drivers/char/tpm/tpmrm-dev.c
+++ b/drivers/char/tpm/tpmrm-dev.c
@@ -28,7 +28,7 @@ static int tpmrm_open(struct inode *inode, struct file *file)
return -ENOMEM;
}
- tpm_common_open(file, chip, &priv->priv);
+ tpm_common_open(file, chip, &priv->priv, &priv->space);
return 0;
}
@@ -45,21 +45,11 @@ static int tpmrm_release(struct inode *inode, struct file *file)
return 0;
}
-static ssize_t tpmrm_write(struct file *file, const char __user *buf,
- size_t size, loff_t *off)
-{
- struct file_priv *fpriv = file->private_data;
- struct tpmrm_priv *priv = container_of(fpriv, struct tpmrm_priv, priv);
-
- return tpm_common_write(file, buf, size, off, &priv->space);
-}
-
const struct file_operations tpmrm_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.open = tpmrm_open,
.read = tpm_common_read,
- .write = tpmrm_write,
+ .write = tpm_common_write,
.release = tpmrm_release,
};
-