tpm: Pull everything related to /dev/tpmX into tpm-dev.c
CLASS-dev.c is a common idiom for Linux subsystems This pulls all the code related to the miscdev into tpm-dev.c and makes it static. The identical file_operation structs in the drivers are purged and the tpm common code unconditionally creates the miscdev. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Reviewed-by: Joel Schopp <jschopp@linux.vnet.ibm.com> Reviewed-by: Ashley Lai <adlai@linux.vnet.ibm.com> [phuewe: tpm_dev_release is now used only in this file, thus the EXPORT_SYMBOL can be dropped and the function be marked as static. It has no other in-kernel users] Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Esse commit está contido em:
@@ -135,15 +135,6 @@ static u8 i2c_atmel_read_status(struct tpm_chip *chip)
|
||||
return ATMEL_STS_OK;
|
||||
}
|
||||
|
||||
static const struct file_operations i2c_atmel_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.open = tpm_open,
|
||||
.read = tpm_read,
|
||||
.write = tpm_write,
|
||||
.release = tpm_release,
|
||||
};
|
||||
|
||||
static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
|
||||
static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
|
||||
static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
|
||||
@@ -187,7 +178,6 @@ static const struct tpm_vendor_specific i2c_atmel = {
|
||||
.req_complete_val = ATMEL_STS_OK,
|
||||
.req_canceled = i2c_atmel_req_canceled,
|
||||
.attr_group = &i2c_atmel_attr_grp,
|
||||
.miscdev.fops = &i2c_atmel_ops,
|
||||
};
|
||||
|
||||
static int i2c_atmel_probe(struct i2c_client *client,
|
||||
|
Referência em uma nova issue
Block a user