Skip to content

Commit

Permalink
regmap: spi-avmm: Use swabXX_array() helpers
Browse files Browse the repository at this point in the history
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
andy-shev authored and intel-lab-lkp committed Aug 31, 2022
1 parent 1935e2e commit 7836186
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/base/regmap/regmap-spi-avmm.c
Expand Up @@ -7,6 +7,7 @@
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <linux/swab.h>

/*
* This driver implements the regmap operations for a generic SPI
Expand Down Expand Up @@ -167,14 +168,7 @@ struct spi_avmm_bridge {

static void br_swap_words_32(char *buf, unsigned int len)
{
u32 *p = (u32 *)buf;
unsigned int count;

count = len / 4;
while (count--) {
*p = swab32p(p);
p++;
}
swab32_array(buf, len / 4);
}

/*
Expand Down

0 comments on commit 7836186

Please sign in to comment.