lkml.org 
[lkml]   [2019]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 9/9] ASoC/fsl_spdif: Use put_unaligned_be24() instead of open-coding it
Date
This patch makes the code easier to read.

Cc: Timur Tabi <timur@kernel.org>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
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
\
 
 \ /
  Last update: 2019-10-28 21:08    [W:0.160 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site