mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
tpm: fix type of a local variables in tpm_tis_spi.c
Use __le32 type for data in that format.
Fixes: 0edbfea537 ("tpm/tpm_tis_spi: Add support for spi phy")
Signed-off-by: Jarkko Sakkinen <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
This commit is contained in:
parent
4557d4bedc
commit
1a7a9b26c6
1 changed files with 18 additions and 7 deletions
|
|
@ -152,29 +152,40 @@ static int tpm_tis_spi_write_bytes(struct tpm_tis_data *data, u32 addr,
|
|||
|
||||
static int tpm_tis_spi_read16(struct tpm_tis_data *data, u32 addr, u16 *result)
|
||||
{
|
||||
__le16 result_le;
|
||||
int rc;
|
||||
|
||||
rc = data->phy_ops->read_bytes(data, addr, sizeof(u16), (u8 *)result);
|
||||
rc = data->phy_ops->read_bytes(data, addr, sizeof(u16),
|
||||
(u8 *)&result_le);
|
||||
if (!rc)
|
||||
*result = le16_to_cpu(*result);
|
||||
*result = le16_to_cpu(result_le);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int tpm_tis_spi_read32(struct tpm_tis_data *data, u32 addr, u32 *result)
|
||||
{
|
||||
__le32 result_le;
|
||||
int rc;
|
||||
|
||||
rc = data->phy_ops->read_bytes(data, addr, sizeof(u32), (u8 *)result);
|
||||
rc = data->phy_ops->read_bytes(data, addr, sizeof(u32),
|
||||
(u8 *)&result_le);
|
||||
if (!rc)
|
||||
*result = le32_to_cpu(*result);
|
||||
*result = le32_to_cpu(result_le);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int tpm_tis_spi_write32(struct tpm_tis_data *data, u32 addr, u32 value)
|
||||
{
|
||||
value = cpu_to_le32(value);
|
||||
return data->phy_ops->write_bytes(data, addr, sizeof(u32),
|
||||
(u8 *)&value);
|
||||
__le32 value_le;
|
||||
int rc;
|
||||
|
||||
value_le = cpu_to_le32(value);
|
||||
rc = data->phy_ops->write_bytes(data, addr, sizeof(u32),
|
||||
(u8 *)&value_le);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static const struct tpm_tis_phy_ops tpm_spi_phy_ops = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue