Skip to content

Commit 6434ead

Browse files
committed
Merge tag 'tpmdd-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd
Pull tpm updates from Jarkko Sakkinen: "Just a couple fixes and no new features" * tag 'tpmdd-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm: cr50: fix kernel-doc warning and spelling tpm: nuvoton: Use i2c_get_match_data()
2 parents 120a201 + 2b6fad7 commit 6434ead

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

drivers/char/tpm/tpm_i2c_nuvoton.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#include <linux/interrupt.h>
2020
#include <linux/wait.h>
2121
#include <linux/i2c.h>
22-
#include <linux/of_device.h>
22+
#include <linux/of.h>
23+
#include <linux/property.h>
2324
#include "tpm.h"
2425

2526
/* I2C interface offsets */
@@ -524,7 +525,6 @@ static int get_vid(struct i2c_client *client, u32 *res)
524525

525526
static int i2c_nuvoton_probe(struct i2c_client *client)
526527
{
527-
const struct i2c_device_id *id = i2c_client_get_device_id(client);
528528
int rc;
529529
struct tpm_chip *chip;
530530
struct device *dev = &client->dev;
@@ -546,15 +546,8 @@ static int i2c_nuvoton_probe(struct i2c_client *client)
546546
if (!priv)
547547
return -ENOMEM;
548548

549-
if (dev->of_node) {
550-
const struct of_device_id *of_id;
551-
552-
of_id = of_match_device(dev->driver->of_match_table, dev);
553-
if (of_id && of_id->data == OF_IS_TPM2)
554-
chip->flags |= TPM_CHIP_FLAG_TPM2;
555-
} else
556-
if (id->driver_data == I2C_IS_TPM2)
557-
chip->flags |= TPM_CHIP_FLAG_TPM2;
549+
if (i2c_get_match_data(client))
550+
chip->flags |= TPM_CHIP_FLAG_TPM2;
558551

559552
init_waitqueue_head(&priv->read_queue);
560553

drivers/char/tpm/tpm_tis_i2c_cr50.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static int tpm_cr50_i2c_read(struct tpm_chip *chip, u8 addr, u8 *buffer, size_t
235235
* @len: Number of bytes to write.
236236
*
237237
* The provided address is prepended to the data in 'buffer', the
238-
* cobined address+data is sent to the TPM, then wait for TPM to
238+
* combined address+data is sent to the TPM, then wait for TPM to
239239
* indicate it is done writing.
240240
*
241241
* Return:
@@ -671,7 +671,6 @@ MODULE_DEVICE_TABLE(of, of_cr50_i2c_match);
671671
/**
672672
* tpm_cr50_i2c_probe() - Driver probe function.
673673
* @client: I2C client information.
674-
* @id: I2C device id.
675674
*
676675
* Return:
677676
* - 0: Success.

0 commit comments

Comments
 (0)