Commit 26cc2a78 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

regmap: spi-avmm: Use swabXX_array() helpers

Since we have a few helpers to swab elements of a given size in an array
use them instead of open coded variants.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220831212744.56435-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 400dceb6
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/swab.h>
/* /*
* This driver implements the regmap operations for a generic SPI * This driver implements the regmap operations for a generic SPI
...@@ -162,19 +163,12 @@ struct spi_avmm_bridge { ...@@ -162,19 +163,12 @@ struct spi_avmm_bridge {
/* bridge buffer used in translation between protocol layers */ /* bridge buffer used in translation between protocol layers */
char trans_buf[TRANS_BUF_SIZE]; char trans_buf[TRANS_BUF_SIZE];
char phy_buf[PHY_BUF_SIZE]; char phy_buf[PHY_BUF_SIZE];
void (*swap_words)(char *buf, unsigned int len); void (*swap_words)(void *buf, unsigned int len);
}; };
static void br_swap_words_32(char *buf, unsigned int len) static void br_swap_words_32(void *buf, unsigned int len)
{ {
u32 *p = (u32 *)buf; swab32_array(buf, len / 4);
unsigned int count;
count = len / 4;
while (count--) {
*p = swab32p(p);
p++;
}
} }
/* /*
......
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