hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/char/tpm/tpm_i2c_nuvoton.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /******************************************************************************
23 * Nuvoton TPM I2C Device Driver Interface for WPCT301/NPCT501/NPCT6XX,
34 * based on the TCG TPM Interface Spec version 1.2.
....@@ -7,19 +8,6 @@
78 * Dan Morav <dan.morav@nuvoton.com>
89 * Copyright (C) 2013, Obsidian Research Corp.
910 * Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
10
- *
11
- * This program is free software: you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation, either version 2 of the License, or
14
- * (at your option) any later version.
15
- *
16
- * This program is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU General Public License
22
- * along with this program. If not, see http://www.gnu.org/licenses/>.
2311 *
2412 * Nuvoton contact information: APC.Support@nuvoton.com
2513 *****************************************************************************/
....@@ -454,14 +442,12 @@
454442 return rc;
455443 }
456444 ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
457
- if (chip->flags & TPM_CHIP_FLAG_TPM2)
458
- duration = tpm2_calc_ordinal_duration(chip, ordinal);
459
- else
460
- duration = tpm_calc_ordinal_duration(chip, ordinal);
445
+ duration = tpm_calc_ordinal_duration(chip, ordinal);
461446
462447 rc = i2c_nuvoton_wait_for_data_avail(chip, duration, &priv->read_queue);
463448 if (rc) {
464
- dev_err(dev, "%s() timeout command duration\n", __func__);
449
+ dev_err(dev, "%s() timeout command duration %ld\n",
450
+ __func__, duration);
465451 i2c_nuvoton_ready(chip);
466452 return rc;
467453 }