Skip to content

Commit 5a3c2f7

Browse files
committed
fsi: scom: Fixup endian annotations
Use the proper annotated type __be32 and fixup the accessor used for get_scom() Signed-off-by: Benjamin Herrenschmidt <[email protected]> Reviewed-by: Eddie James <[email protected]>
1 parent bd21336 commit 5a3c2f7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/fsi/fsi-scom.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ static DEFINE_IDA(scom_ida);
5151
static int put_scom(struct scom_device *scom_dev, uint64_t value,
5252
uint32_t addr)
5353
{
54+
__be32 data;
5455
int rc;
55-
uint32_t data;
5656

5757
mutex_lock(&scom_dev->lock);
5858

@@ -79,7 +79,7 @@ static int put_scom(struct scom_device *scom_dev, uint64_t value,
7979
static int get_scom(struct scom_device *scom_dev, uint64_t *value,
8080
uint32_t addr)
8181
{
82-
uint32_t result, data;
82+
__be32 result, data;
8383
int rc;
8484

8585

@@ -96,14 +96,13 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value,
9696
if (rc)
9797
goto bail;
9898

99-
*value |= (uint64_t)cpu_to_be32(result) << 32;
99+
*value |= (uint64_t)be32_to_cpu(result) << 32;
100100
rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA1_REG, &result,
101101
sizeof(uint32_t));
102102
if (rc)
103103
goto bail;
104104

105-
*value |= cpu_to_be32(result);
106-
105+
*value |= be32_to_cpu(result);
107106
bail:
108107
mutex_unlock(&scom_dev->lock);
109108
return rc;

0 commit comments

Comments
 (0)