Release 4.15 drivers/char/tpm/tpmrm-dev.c
/*
* Copyright (C) 2017 James.Bottomley@HansenPartnership.com
*
* GPLv2
*/
#include <linux/slab.h>
#include "tpm-dev.h"
struct tpmrm_priv {
struct file_priv priv;
struct tpm_space space;
};
static int tpmrm_open(struct inode *inode, struct file *file)
{
struct tpm_chip *chip;
struct tpmrm_priv *priv;
int rc;
chip = container_of(inode->i_cdev, struct tpm_chip, cdevs);
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (priv == NULL)
return -ENOMEM;
rc = tpm2_init_space(&priv->space);
if (rc) {
kfree(priv);
return -ENOMEM;
}
tpm_common_open(file, chip, &priv->priv);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
James Bottomley | 106 | 100.00% | 1 | 100.00% |
Total | 106 | 100.00% | 1 | 100.00% |
static int tpmrm_release(struct inode *inode, struct file *file)
{
struct file_priv *fpriv = file->private_data;
struct tpmrm_priv *priv = container_of(fpriv, struct tpmrm_priv, priv);
tpm_common_release(file, fpriv);
tpm2_del_space(fpriv->chip, &priv->space);
kfree(priv);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
James Bottomley | 67 | 100.00% | 2 | 100.00% |
Total | 67 | 100.00% | 2 | 100.00% |
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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
James Bottomley | 64 | 98.46% | 1 | 50.00% |
Peter Hüwe | 1 | 1.54% | 1 | 50.00% |
Total | 65 | 100.00% | 2 | 100.00% |
const struct file_operations tpmrm_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.open = tpmrm_open,
.read = tpm_common_read,
.write = tpmrm_write,
.release = tpmrm_release,
};
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
James Bottomley | 294 | 99.66% | 2 | 66.67% |
Peter Hüwe | 1 | 0.34% | 1 | 33.33% |
Total | 295 | 100.00% | 3 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.