fsi: scom: Fixup endian annotations

Use the proper annotated type __be32 and fixup the
accessor used for get_scom()
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: default avatarEddie James <eajames@linux.vnet.ibm.com>
parent bd213364
...@@ -51,8 +51,8 @@ static DEFINE_IDA(scom_ida); ...@@ -51,8 +51,8 @@ static DEFINE_IDA(scom_ida);
static int put_scom(struct scom_device *scom_dev, uint64_t value, static int put_scom(struct scom_device *scom_dev, uint64_t value,
uint32_t addr) uint32_t addr)
{ {
__be32 data;
int rc; int rc;
uint32_t data;
mutex_lock(&scom_dev->lock); mutex_lock(&scom_dev->lock);
...@@ -79,7 +79,7 @@ static int put_scom(struct scom_device *scom_dev, uint64_t value, ...@@ -79,7 +79,7 @@ static int put_scom(struct scom_device *scom_dev, uint64_t value,
static int get_scom(struct scom_device *scom_dev, uint64_t *value, static int get_scom(struct scom_device *scom_dev, uint64_t *value,
uint32_t addr) uint32_t addr)
{ {
uint32_t result, data; __be32 result, data;
int rc; int rc;
...@@ -96,14 +96,13 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value, ...@@ -96,14 +96,13 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value,
if (rc) if (rc)
goto bail; goto bail;
*value |= (uint64_t)cpu_to_be32(result) << 32; *value |= (uint64_t)be32_to_cpu(result) << 32;
rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA1_REG, &result, rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA1_REG, &result,
sizeof(uint32_t)); sizeof(uint32_t));
if (rc) if (rc)
goto bail; goto bail;
*value |= cpu_to_be32(result); *value |= be32_to_cpu(result);
bail: bail:
mutex_unlock(&scom_dev->lock); mutex_unlock(&scom_dev->lock);
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment