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>
This commit is contained in:
Tadeusz Struk
2018-09-10 10:18:28 -07:00
committed by Jarkko Sakkinen
parent 2f7d8dbb11
commit c3d477a725
4 changed files with 12 additions and 25 deletions

View File

@@ -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,
};