Lines Matching +full:com +full:- +full:seq

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Kent Yoder <key@linux.vnet.ibm.com>
7 * Seiji Munetoh <munetoh@jp.ibm.com>
8 * Stefan Berger <stefanb@us.ibm.com>
9 * Reiner Sailer <sailer@watson.ibm.com>
10 * Kylene Hall <kjhall@us.ibm.com>
11 * Nayna Jain <nayna@linux.vnet.ibm.com>
29 struct seq_file *seq; in tpm_bios_measurements_open() local
35 if (!inode->i_private) { in tpm_bios_measurements_open()
37 return -ENODEV; in tpm_bios_measurements_open()
39 chip_seqops = inode->i_private; in tpm_bios_measurements_open()
40 seqops = chip_seqops->seqops; in tpm_bios_measurements_open()
41 chip = chip_seqops->chip; in tpm_bios_measurements_open()
42 get_device(&chip->dev); in tpm_bios_measurements_open()
45 /* now register seq file */ in tpm_bios_measurements_open()
48 seq = file->private_data; in tpm_bios_measurements_open()
49 seq->private = chip; in tpm_bios_measurements_open()
51 put_device(&chip->dev); in tpm_bios_measurements_open()
60 struct seq_file *seq = file->private_data; in tpm_bios_measurements_release() local
61 struct tpm_chip *chip = seq->private; in tpm_bios_measurements_release()
63 put_device(&chip->dev); in tpm_bios_measurements_release()
80 if (chip->log.bios_event_log != NULL) { in tpm_read_log()
81 dev_dbg(&chip->dev, in tpm_read_log()
82 "%s: ERROR - event log already initialized\n", in tpm_read_log()
84 return -EFAULT; in tpm_read_log()
88 if (rc != -ENODEV) in tpm_read_log()
92 if (rc != -ENODEV) in tpm_read_log()
99 * tpm_bios_log_setup() - Read the event log from the firmware
107 const char *name = dev_name(&chip->dev); in tpm_bios_log_setup()
112 if (chip->flags & TPM_CHIP_FLAG_VIRTUAL) in tpm_bios_log_setup()
121 chip->bios_dir[cnt] = securityfs_create_dir(name, NULL); in tpm_bios_log_setup()
125 if (IS_ERR(chip->bios_dir[cnt])) in tpm_bios_log_setup()
129 chip->bin_log_seqops.chip = chip; in tpm_bios_log_setup()
131 chip->bin_log_seqops.seqops = in tpm_bios_log_setup()
134 chip->bin_log_seqops.seqops = in tpm_bios_log_setup()
138 chip->bios_dir[cnt] = in tpm_bios_log_setup()
140 0440, chip->bios_dir[0], in tpm_bios_log_setup()
141 (void *)&chip->bin_log_seqops, in tpm_bios_log_setup()
143 if (IS_ERR(chip->bios_dir[cnt])) in tpm_bios_log_setup()
147 if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) { in tpm_bios_log_setup()
149 chip->ascii_log_seqops.chip = chip; in tpm_bios_log_setup()
150 chip->ascii_log_seqops.seqops = in tpm_bios_log_setup()
153 chip->bios_dir[cnt] = in tpm_bios_log_setup()
155 0440, chip->bios_dir[0], in tpm_bios_log_setup()
156 (void *)&chip->ascii_log_seqops, in tpm_bios_log_setup()
158 if (IS_ERR(chip->bios_dir[cnt])) in tpm_bios_log_setup()
166 chip->bios_dir[cnt] = NULL; in tpm_bios_log_setup()
182 for (i = (TPM_NUM_EVENT_LOG_FILES - 1); i >= 0; i--) { in tpm_bios_log_teardown()
183 if (chip->bios_dir[i]) { in tpm_bios_log_teardown()
184 inode = d_inode(chip->bios_dir[i]); in tpm_bios_log_teardown()
186 inode->i_private = NULL; in tpm_bios_log_teardown()
188 securityfs_remove(chip->bios_dir[i]); in tpm_bios_log_teardown()