]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
spi: amlogic: fix spifc build error
authorXianwei Zhao <xianwei.zhao@amlogic.com>
Wed, 15 Oct 2025 07:36:59 +0000 (15:36 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 15 Oct 2025 13:09:57 +0000 (14:09 +0100)
There is an error building when
Compiler version: gcc (GCC) 14.3.0
Assembler version: GNU assembler (GNU Binutils) 2.44
"
 Error log:
 WARNING: modpost: missing MODULE_DESCRIPTION() in arch/arm/probes/kprobes/test-kprobes.o
 ERROR: modpost: "__ffsdi2" [drivers/spi/spi-amlogic-spifc-a4.ko] undefined!
"

Use __ffs API instead of __bf_shf to be safer.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/f594c621-f9e1-49f2-af31-23fbcb176058@roeck-us.net/
Fixes: 4670db6f32e9 ("spi: amlogic: add driver for Amlogic SPI Flash Controller")
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://patch.msgid.link/20251015-fix-spifc-a4-v1-1-08e0900e5b7e@amlogic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-amlogic-spifc-a4.c

index 4338d00e56a6e84f24220dd7b16769c086044070..35a7c4965e11330828873f10c15f01b01229350f 100644 (file)
@@ -286,7 +286,7 @@ static int aml_sfc_set_bus_width(struct aml_sfc *sfc, u8 buswidth, u32 mask)
 
        for (i = 0; i <= LANE_MAX; i++) {
                if (buswidth == 1 << i) {
-                       conf = i << __bf_shf(mask);
+                       conf = i << __ffs(mask);
                        return regmap_update_bits(sfc->regmap_base, SFC_SPI_CFG,
                                                  mask, conf);
                }
@@ -566,7 +566,7 @@ static int aml_sfc_raw_io_op(struct aml_sfc *sfc, const struct spi_mem_op *op)
        if (!op->data.nbytes)
                goto end_xfer;
 
-       conf = (op->data.nbytes >> RAW_SIZE_BW) << __bf_shf(RAW_EXT_SIZE);
+       conf = (op->data.nbytes >> RAW_SIZE_BW) << __ffs(RAW_EXT_SIZE);
        ret = regmap_update_bits(sfc->regmap_base, SFC_SPI_CFG, RAW_EXT_SIZE, conf);
        if (ret)
                goto err_out;