Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004 IBM Corporation |
| 3 | * Copyright (C) 2014 Intel Corporation |
| 4 | * |
| 5 | * Authors: |
| 6 | * Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
| 7 | * Leendert van Doorn <leendert@watson.ibm.com> |
| 8 | * Dave Safford <safford@watson.ibm.com> |
| 9 | * Reiner Sailer <sailer@watson.ibm.com> |
| 10 | * Kylene Hall <kjhall@us.ibm.com> |
| 11 | * |
| 12 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> |
| 13 | * |
| 14 | * TPM chip management routines. |
| 15 | * |
| 16 | * This program is free software; you can redistribute it and/or |
| 17 | * modify it under the terms of the GNU General Public License as |
| 18 | * published by the Free Software Foundation, version 2 of the |
| 19 | * License. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #include <linux/poll.h> |
| 24 | #include <linux/slab.h> |
| 25 | #include <linux/mutex.h> |
| 26 | #include <linux/spinlock.h> |
| 27 | #include <linux/freezer.h> |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 28 | #include <linux/major.h> |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 29 | #include "tpm.h" |
| 30 | #include "tpm_eventlog.h" |
| 31 | |
| 32 | static DECLARE_BITMAP(dev_mask, TPM_NUM_DEVICES); |
| 33 | static LIST_HEAD(tpm_chip_list); |
| 34 | static DEFINE_SPINLOCK(driver_lock); |
| 35 | |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 36 | struct class *tpm_class; |
| 37 | dev_t tpm_devt; |
| 38 | |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 39 | /** |
| 40 | * tpm_try_get_ops() - Get a ref to the tpm_chip |
| 41 | * @chip: Chip to ref |
| 42 | * |
| 43 | * The caller must already have some kind of locking to ensure that chip is |
| 44 | * valid. This function will lock the chip so that the ops member can be |
| 45 | * accessed safely. The locking prevents tpm_chip_unregister from |
| 46 | * completing, so it should not be held for long periods. |
| 47 | * |
| 48 | * Returns -ERRNO if the chip could not be got. |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 49 | */ |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 50 | int tpm_try_get_ops(struct tpm_chip *chip) |
| 51 | { |
| 52 | int rc = -EIO; |
| 53 | |
| 54 | get_device(&chip->dev); |
| 55 | |
| 56 | down_read(&chip->ops_sem); |
| 57 | if (!chip->ops) |
| 58 | goto out_lock; |
| 59 | |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 60 | return 0; |
| 61 | out_lock: |
| 62 | up_read(&chip->ops_sem); |
| 63 | put_device(&chip->dev); |
| 64 | return rc; |
| 65 | } |
| 66 | EXPORT_SYMBOL_GPL(tpm_try_get_ops); |
| 67 | |
| 68 | /** |
| 69 | * tpm_put_ops() - Release a ref to the tpm_chip |
| 70 | * @chip: Chip to put |
| 71 | * |
| 72 | * This is the opposite pair to tpm_try_get_ops(). After this returns chip may |
| 73 | * be kfree'd. |
| 74 | */ |
| 75 | void tpm_put_ops(struct tpm_chip *chip) |
| 76 | { |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 77 | up_read(&chip->ops_sem); |
| 78 | put_device(&chip->dev); |
| 79 | } |
| 80 | EXPORT_SYMBOL_GPL(tpm_put_ops); |
| 81 | |
| 82 | /** |
| 83 | * tpm_chip_find_get() - return tpm_chip for a given chip number |
| 84 | * @chip_num: id to find |
| 85 | * |
| 86 | * The return'd chip has been tpm_try_get_ops'd and must be released via |
| 87 | * tpm_put_ops |
| 88 | */ |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 89 | struct tpm_chip *tpm_chip_find_get(int chip_num) |
| 90 | { |
| 91 | struct tpm_chip *pos, *chip = NULL; |
| 92 | |
| 93 | rcu_read_lock(); |
| 94 | list_for_each_entry_rcu(pos, &tpm_chip_list, list) { |
| 95 | if (chip_num != TPM_ANY_NUM && chip_num != pos->dev_num) |
| 96 | continue; |
| 97 | |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 98 | /* rcu prevents chip from being free'd */ |
| 99 | if (!tpm_try_get_ops(pos)) |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 100 | chip = pos; |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 101 | break; |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 102 | } |
| 103 | rcu_read_unlock(); |
| 104 | return chip; |
| 105 | } |
| 106 | |
| 107 | /** |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 108 | * tpm_dev_release() - free chip memory and the device number |
| 109 | * @dev: the character device for the TPM chip |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 110 | * |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 111 | * This is used as the release function for the character device. |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 112 | */ |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 113 | static void tpm_dev_release(struct device *dev) |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 114 | { |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 115 | struct tpm_chip *chip = container_of(dev, struct tpm_chip, dev); |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 116 | |
| 117 | spin_lock(&driver_lock); |
| 118 | clear_bit(chip->dev_num, dev_mask); |
| 119 | spin_unlock(&driver_lock); |
| 120 | kfree(chip); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * tpmm_chip_alloc() - allocate a new struct tpm_chip instance |
| 125 | * @dev: device to which the chip is associated |
| 126 | * @ops: struct tpm_class_ops instance |
| 127 | * |
| 128 | * Allocates a new struct tpm_chip instance and assigns a free |
| 129 | * device number for it. Caller does not have to worry about |
| 130 | * freeing the allocated resources. When the devices is removed |
| 131 | * devres calls tpmm_chip_remove() to do the job. |
| 132 | */ |
| 133 | struct tpm_chip *tpmm_chip_alloc(struct device *dev, |
| 134 | const struct tpm_class_ops *ops) |
| 135 | { |
| 136 | struct tpm_chip *chip; |
Jarkko Sakkinen | 4f3b193 | 2016-02-13 11:58:16 +0200 | [diff] [blame] | 137 | int rc; |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 138 | |
| 139 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); |
| 140 | if (chip == NULL) |
| 141 | return ERR_PTR(-ENOMEM); |
| 142 | |
| 143 | mutex_init(&chip->tpm_mutex); |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 144 | init_rwsem(&chip->ops_sem); |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 145 | INIT_LIST_HEAD(&chip->list); |
| 146 | |
| 147 | chip->ops = ops; |
| 148 | |
| 149 | spin_lock(&driver_lock); |
| 150 | chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES); |
| 151 | spin_unlock(&driver_lock); |
| 152 | |
| 153 | if (chip->dev_num >= TPM_NUM_DEVICES) { |
| 154 | dev_err(dev, "No available tpm device numbers\n"); |
| 155 | kfree(chip); |
| 156 | return ERR_PTR(-ENOMEM); |
| 157 | } |
| 158 | |
| 159 | set_bit(chip->dev_num, dev_mask); |
| 160 | |
Jason Gunthorpe | 3635e2e | 2016-02-29 12:29:48 -0500 | [diff] [blame] | 161 | device_initialize(&chip->dev); |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 162 | |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 163 | dev_set_drvdata(dev, chip); |
| 164 | |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 165 | chip->dev.class = tpm_class; |
| 166 | chip->dev.release = tpm_dev_release; |
Jason Gunthorpe | 8cfffc9 | 2016-02-29 12:29:47 -0500 | [diff] [blame] | 167 | chip->dev.parent = dev; |
Jarkko Sakkinen | 9b774d5 | 2015-04-14 17:56:48 +0300 | [diff] [blame] | 168 | #ifdef CONFIG_ACPI |
| 169 | chip->dev.groups = chip->groups; |
| 170 | #endif |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 171 | |
| 172 | if (chip->dev_num == 0) |
| 173 | chip->dev.devt = MKDEV(MISC_MAJOR, TPM_MINOR); |
| 174 | else |
| 175 | chip->dev.devt = MKDEV(MAJOR(tpm_devt), chip->dev_num); |
| 176 | |
Jason Gunthorpe | 3635e2e | 2016-02-29 12:29:48 -0500 | [diff] [blame] | 177 | rc = dev_set_name(&chip->dev, "tpm%d", chip->dev_num); |
| 178 | if (rc) |
| 179 | goto out; |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 180 | |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 181 | cdev_init(&chip->cdev, &tpm_fops); |
Stefan Berger | 2072df4 | 2016-02-29 08:53:01 -0500 | [diff] [blame^] | 182 | chip->cdev.owner = THIS_MODULE; |
Jason Gunthorpe | ba0ef85 | 2015-06-30 13:15:31 -0600 | [diff] [blame] | 183 | chip->cdev.kobj.parent = &chip->dev.kobj; |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 184 | |
Jarkko Sakkinen | 4f3b193 | 2016-02-13 11:58:16 +0200 | [diff] [blame] | 185 | rc = devm_add_action(dev, (void (*)(void *)) put_device, &chip->dev); |
| 186 | if (rc) { |
| 187 | put_device(&chip->dev); |
| 188 | return ERR_PTR(rc); |
| 189 | } |
Jarkko Sakkinen | 8e0ee3c | 2016-02-08 22:31:08 +0200 | [diff] [blame] | 190 | |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 191 | return chip; |
Jason Gunthorpe | 3635e2e | 2016-02-29 12:29:48 -0500 | [diff] [blame] | 192 | |
| 193 | out: |
| 194 | put_device(&chip->dev); |
| 195 | return ERR_PTR(rc); |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 196 | } |
| 197 | EXPORT_SYMBOL_GPL(tpmm_chip_alloc); |
| 198 | |
Jarkko Sakkinen | 72c91ce | 2016-01-29 09:47:22 -0800 | [diff] [blame] | 199 | static int tpm_add_char_device(struct tpm_chip *chip) |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 200 | { |
| 201 | int rc; |
| 202 | |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 203 | rc = cdev_add(&chip->cdev, chip->dev.devt, 1); |
| 204 | if (rc) { |
| 205 | dev_err(&chip->dev, |
| 206 | "unable to cdev_add() %s, major %d, minor %d, err=%d\n", |
Jason Gunthorpe | 3635e2e | 2016-02-29 12:29:48 -0500 | [diff] [blame] | 207 | dev_name(&chip->dev), MAJOR(chip->dev.devt), |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 208 | MINOR(chip->dev.devt), rc); |
| 209 | |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 210 | return rc; |
| 211 | } |
| 212 | |
Jarkko Sakkinen | d972b05 | 2015-03-01 23:55:47 +0200 | [diff] [blame] | 213 | rc = device_add(&chip->dev); |
| 214 | if (rc) { |
| 215 | dev_err(&chip->dev, |
| 216 | "unable to device_register() %s, major %d, minor %d, err=%d\n", |
Jason Gunthorpe | 3635e2e | 2016-02-29 12:29:48 -0500 | [diff] [blame] | 217 | dev_name(&chip->dev), MAJOR(chip->dev.devt), |
Jarkko Sakkinen | d972b05 | 2015-03-01 23:55:47 +0200 | [diff] [blame] | 218 | MINOR(chip->dev.devt), rc); |
| 219 | |
Jarkko Sakkinen | 72c91ce | 2016-01-29 09:47:22 -0800 | [diff] [blame] | 220 | cdev_del(&chip->cdev); |
Jarkko Sakkinen | d972b05 | 2015-03-01 23:55:47 +0200 | [diff] [blame] | 221 | return rc; |
| 222 | } |
| 223 | |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 224 | return rc; |
| 225 | } |
| 226 | |
Jarkko Sakkinen | 72c91ce | 2016-01-29 09:47:22 -0800 | [diff] [blame] | 227 | static void tpm_del_char_device(struct tpm_chip *chip) |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 228 | { |
| 229 | cdev_del(&chip->cdev); |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 230 | |
| 231 | /* Make the driver uncallable. */ |
| 232 | down_write(&chip->ops_sem); |
| 233 | chip->ops = NULL; |
| 234 | up_write(&chip->ops_sem); |
| 235 | |
Jarkko Sakkinen | 8e0ee3c | 2016-02-08 22:31:08 +0200 | [diff] [blame] | 236 | device_del(&chip->dev); |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 237 | } |
| 238 | |
Jarkko Sakkinen | 34d47b6 | 2015-03-18 08:17:14 +0200 | [diff] [blame] | 239 | static int tpm1_chip_register(struct tpm_chip *chip) |
| 240 | { |
| 241 | int rc; |
| 242 | |
| 243 | if (chip->flags & TPM_CHIP_FLAG_TPM2) |
| 244 | return 0; |
| 245 | |
| 246 | rc = tpm_sysfs_add_device(chip); |
| 247 | if (rc) |
| 248 | return rc; |
| 249 | |
Jason Gunthorpe | 3635e2e | 2016-02-29 12:29:48 -0500 | [diff] [blame] | 250 | chip->bios_dir = tpm_bios_log_setup(dev_name(&chip->dev)); |
Jarkko Sakkinen | 34d47b6 | 2015-03-18 08:17:14 +0200 | [diff] [blame] | 251 | |
| 252 | return 0; |
| 253 | } |
| 254 | |
| 255 | static void tpm1_chip_unregister(struct tpm_chip *chip) |
| 256 | { |
| 257 | if (chip->flags & TPM_CHIP_FLAG_TPM2) |
| 258 | return; |
| 259 | |
| 260 | if (chip->bios_dir) |
| 261 | tpm_bios_log_teardown(chip->bios_dir); |
| 262 | |
Jarkko Sakkinen | 34d47b6 | 2015-03-18 08:17:14 +0200 | [diff] [blame] | 263 | tpm_sysfs_del_device(chip); |
| 264 | } |
| 265 | |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 266 | /* |
Jarkko Sakkinen | 313d21e | 2014-12-12 11:46:37 -0800 | [diff] [blame] | 267 | * tpm_chip_register() - create a character device for the TPM chip |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 268 | * @chip: TPM chip to use. |
| 269 | * |
Jarkko Sakkinen | d972b05 | 2015-03-01 23:55:47 +0200 | [diff] [blame] | 270 | * Creates a character device for the TPM chip and adds sysfs attributes for |
| 271 | * the device. As the last step this function adds the chip to the list of TPM |
| 272 | * chips available for in-kernel use. |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 273 | * |
Jarkko Sakkinen | d972b05 | 2015-03-01 23:55:47 +0200 | [diff] [blame] | 274 | * This function should be only called after the chip initialization is |
| 275 | * complete. |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 276 | */ |
| 277 | int tpm_chip_register(struct tpm_chip *chip) |
| 278 | { |
| 279 | int rc; |
| 280 | |
Jarkko Sakkinen | 34d47b6 | 2015-03-18 08:17:14 +0200 | [diff] [blame] | 281 | rc = tpm1_chip_register(chip); |
| 282 | if (rc) |
| 283 | return rc; |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 284 | |
Jarkko Sakkinen | 9b774d5 | 2015-04-14 17:56:48 +0300 | [diff] [blame] | 285 | tpm_add_ppi(chip); |
| 286 | |
Jarkko Sakkinen | 72c91ce | 2016-01-29 09:47:22 -0800 | [diff] [blame] | 287 | rc = tpm_add_char_device(chip); |
Jarkko Sakkinen | d972b05 | 2015-03-01 23:55:47 +0200 | [diff] [blame] | 288 | if (rc) |
Jarkko Sakkinen | 34d47b6 | 2015-03-18 08:17:14 +0200 | [diff] [blame] | 289 | goto out_err; |
Jarkko Sakkinen | d972b05 | 2015-03-01 23:55:47 +0200 | [diff] [blame] | 290 | |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 291 | /* Make the chip available. */ |
| 292 | spin_lock(&driver_lock); |
Jarkko Sakkinen | b1a4144 | 2015-11-02 19:55:29 +0200 | [diff] [blame] | 293 | list_add_tail_rcu(&chip->list, &tpm_chip_list); |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 294 | spin_unlock(&driver_lock); |
| 295 | |
| 296 | chip->flags |= TPM_CHIP_FLAG_REGISTERED; |
| 297 | |
Jarkko Sakkinen | d56e4f7 | 2015-11-07 13:33:25 +0200 | [diff] [blame] | 298 | if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) { |
Jason Gunthorpe | 8cfffc9 | 2016-02-29 12:29:47 -0500 | [diff] [blame] | 299 | rc = __compat_only_sysfs_link_entry_to_kobj( |
| 300 | &chip->dev.parent->kobj, &chip->dev.kobj, "ppi"); |
Jarkko Sakkinen | d56e4f7 | 2015-11-07 13:33:25 +0200 | [diff] [blame] | 301 | if (rc && rc != -ENOENT) { |
| 302 | tpm_chip_unregister(chip); |
| 303 | return rc; |
| 304 | } |
| 305 | } |
| 306 | |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 307 | return 0; |
Jarkko Sakkinen | 34d47b6 | 2015-03-18 08:17:14 +0200 | [diff] [blame] | 308 | out_err: |
| 309 | tpm1_chip_unregister(chip); |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 310 | return rc; |
| 311 | } |
| 312 | EXPORT_SYMBOL_GPL(tpm_chip_register); |
| 313 | |
| 314 | /* |
| 315 | * tpm_chip_unregister() - release the TPM driver |
| 316 | * @chip: TPM chip to use. |
| 317 | * |
| 318 | * Takes the chip first away from the list of available TPM chips and then |
| 319 | * cleans up all the resources reserved by tpm_chip_register(). |
| 320 | * |
Jason Gunthorpe | 4e26195 | 2016-02-12 20:29:53 -0700 | [diff] [blame] | 321 | * Once this function returns the driver call backs in 'op's will not be |
| 322 | * running and will no longer start. |
| 323 | * |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 324 | * NOTE: This function should be only called before deinitializing chip |
| 325 | * resources. |
| 326 | */ |
| 327 | void tpm_chip_unregister(struct tpm_chip *chip) |
| 328 | { |
| 329 | if (!(chip->flags & TPM_CHIP_FLAG_REGISTERED)) |
| 330 | return; |
| 331 | |
| 332 | spin_lock(&driver_lock); |
| 333 | list_del_rcu(&chip->list); |
| 334 | spin_unlock(&driver_lock); |
| 335 | synchronize_rcu(); |
| 336 | |
Jarkko Sakkinen | 9b774d5 | 2015-04-14 17:56:48 +0300 | [diff] [blame] | 337 | if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) |
Jason Gunthorpe | 8cfffc9 | 2016-02-29 12:29:47 -0500 | [diff] [blame] | 338 | sysfs_remove_link(&chip->dev.parent->kobj, "ppi"); |
Jarkko Sakkinen | 9b774d5 | 2015-04-14 17:56:48 +0300 | [diff] [blame] | 339 | |
Jarkko Sakkinen | 34d47b6 | 2015-03-18 08:17:14 +0200 | [diff] [blame] | 340 | tpm1_chip_unregister(chip); |
Jarkko Sakkinen | 72c91ce | 2016-01-29 09:47:22 -0800 | [diff] [blame] | 341 | tpm_del_char_device(chip); |
Jarkko Sakkinen | afb5abc | 2014-12-12 11:46:34 -0800 | [diff] [blame] | 342 | } |
| 343 | EXPORT_SYMBOL_GPL(tpm_chip_unregister); |