| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /****************************************************************************** |
|---|
| 2 | 3 | * Nuvoton TPM I2C Device Driver Interface for WPCT301/NPCT501/NPCT6XX, |
|---|
| 3 | 4 | * based on the TCG TPM Interface Spec version 1.2. |
|---|
| .. | .. |
|---|
| 7 | 8 | * Dan Morav <dan.morav@nuvoton.com> |
|---|
| 8 | 9 | * Copyright (C) 2013, Obsidian Research Corp. |
|---|
| 9 | 10 | * 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/>. |
|---|
| 23 | 11 | * |
|---|
| 24 | 12 | * Nuvoton contact information: APC.Support@nuvoton.com |
|---|
| 25 | 13 | *****************************************************************************/ |
|---|
| .. | .. |
|---|
| 454 | 442 | return rc; |
|---|
| 455 | 443 | } |
|---|
| 456 | 444 | 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); |
|---|
| 461 | 446 | |
|---|
| 462 | 447 | rc = i2c_nuvoton_wait_for_data_avail(chip, duration, &priv->read_queue); |
|---|
| 463 | 448 | 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); |
|---|
| 465 | 451 | i2c_nuvoton_ready(chip); |
|---|
| 466 | 452 | return rc; |
|---|
| 467 | 453 | } |
|---|