diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-09-01 00:27:44 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-09-07 14:42:27 +0300 |
commit | 26cc2a788a1903da3ccff97061099f091255ecaf (patch) | |
tree | 127df5c4f5883e52695f5719f59b18b2fa79e07a /drivers/base/regmap | |
parent | 400dceb6f8b56472b36c5c2c8c3e0cbb7557d019 (diff) | |
download | linux-26cc2a788a1903da3ccff97061099f091255ecaf.tar.xz |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220831212744.56435-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/regmap-spi-avmm.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/base/regmap/regmap-spi-avmm.c b/drivers/base/regmap/regmap-spi-avmm.c index ad1da83e849f..4c2b94b3e30b 100644 --- a/drivers/base/regmap/regmap-spi-avmm.c +++ b/drivers/base/regmap/regmap-spi-avmm.c @@ -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 @@ -162,19 +163,12 @@ struct spi_avmm_bridge { /* bridge buffer used in translation between protocol layers */ char trans_buf[TRANS_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; - unsigned int count; - - count = len / 4; - while (count--) { - *p = swab32p(p); - p++; - } + swab32_array(buf, len / 4); } /* |