[PATCH 9/9] ASoC/fsl_spdif: Use put_unaligned_be24() instead of open-coding it

From: Bart Van Assche
Date: Mon Oct 28 2019 - 16:07:30 EST


This patch makes the code easier to read.

Cc: Timur Tabi <timur@xxxxxxxxxx>
Cc: Nicolin Chen <nicoleotsuka@xxxxxxxxx>
Cc: Xiubo Li <Xiubo.Lee@xxxxxxxxx>
Cc: Fabio Estevam <festevam@xxxxxxxxx>
Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxx>
Cc: Jaroslav Kysela <perex@xxxxxxxx>
Cc: Takashi Iwai <tiwai@xxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
sound/soc/fsl/fsl_spdif.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 7858a5499ac5..8e80ae16f566 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -16,6 +16,7 @@
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/regmap.h>
+#include <asm/unaligned.h>

#include <sound/asoundef.h>
#include <sound/dmaengine_pcm.h>
@@ -173,9 +174,7 @@ static void spdif_irq_uqrx_full(struct fsl_spdif_priv *spdif_priv, char name)
}

regmap_read(regmap, reg, &val);
- ctrl->subcode[*pos++] = val >> 16;
- ctrl->subcode[*pos++] = val >> 8;
- ctrl->subcode[*pos++] = val;
+ put_unaligned_be24(val, &ctrl->subcode[*pos]);
}

/* U/Q Channel sync found */
--
2.24.0.rc0.303.g954a862665-goog