summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/char/tpm/tpm_i2c_stm_st33.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c
index 8c60d33d116c..16f1f785c0b9 100644
--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
@@ -96,15 +96,13 @@ enum tis_defaults {
static int write8_reg(struct i2c_client *client, u8 tpm_register,
u8 *tpm_data, u16 tpm_size)
{
- u8 data;
int value = 0;
struct st33zp24_platform_data *pin_infos;
pin_infos = client->dev.platform_data;
- data = tpm_register;
- memcpy(pin_infos->tpm_i2c_buffer[0], &data, sizeof(data));
- memcpy(pin_infos->tpm_i2c_buffer[0] + 1, tpm_data, tpm_size);
+ pin_infos->tpm_i2c_buffer[0][0] = tpm_register;
+ memcpy(&pin_infos->tpm_i2c_buffer[0][1], tpm_data, tpm_size);
value = i2c_master_send(client, pin_infos->tpm_i2c_buffer[0],
tpm_size + 1);
return value;