[soc:board-remove-7.3 226/294] drivers/mtd/spi-nor/core.c:3394:12: error: static declaration of 'spi_nor_scan' follows non-static declaration

kernel test robot lkp at intel.com
Thu Sep 10 08:41:00 PDT 2026


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git board-remove-7.3
head:   3ac93c1e700558259ea604f7d4f37e26820fba15
commit: 62e3b560c8fdcab6be5dce819f3b76df95cd95dc [226/294] mtd: spi-nor: remove controller_ops support
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260910/202609100538.2YmRyN5u-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/202609100538.2YmRyN5u-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609100538.2YmRyN5u-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/mtd/spi-nor/core.c: In function 'spi_nor_read_id':
>> drivers/mtd/spi-nor/core.c:351:13: warning: unused variable 'ret' [-Wunused-variable]
     351 |         int ret;
         |             ^~~
   drivers/mtd/spi-nor/core.c: In function 'spi_nor_erase_sector':
>> drivers/mtd/spi-nor/core.c:1333:13: warning: unused variable 'i' [-Wunused-variable]
    1333 |         int i;
         |             ^
   drivers/mtd/spi-nor/core.c: In function 'spi_nor_setup':
>> drivers/mtd/spi-nor/core.c:2579:13: warning: unused variable 'ignored_mask' [-Wunused-variable]
    2579 |         u32 ignored_mask, shared_mask;
         |             ^~~~~~~~~~~~
   drivers/mtd/spi-nor/core.c: At top level:
>> drivers/mtd/spi-nor/core.c:3394:12: error: static declaration of 'spi_nor_scan' follows non-static declaration
    3394 | static int spi_nor_scan(struct spi_nor *nor, const char *name,
         |            ^~~~~~~~~~~~
   In file included from drivers/mtd/spi-nor/core.c:18:
   include/linux/mtd/spi-nor.h:419:5: note: previous declaration of 'spi_nor_scan' with type 'int(struct spi_nor *, const char *, const struct spi_nor_hwcaps *)'
     419 | int spi_nor_scan(struct spi_nor *nor, const char *name,
         |     ^~~~~~~~~~~~
--
   drivers/mtd/spi-nor/spansion.c: In function 'spansion_nor_clear_sr':
>> drivers/mtd/spi-nor/spansion.c:100:23: error: implicit declaration of function 'spi_nor_controller_ops_write_reg' [-Wimplicit-function-declaration]
     100 |                 ret = spi_nor_controller_ops_write_reg(nor, SPINOR_OP_CLSR,
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   drivers/mtd/spi-nor/winbond.c: In function 'winbond_nor_select_die':
>> drivers/mtd/spi-nor/winbond.c:122:23: error: implicit declaration of function 'spi_nor_controller_ops_write_reg' [-Wimplicit-function-declaration]
     122 |                 ret = spi_nor_controller_ops_write_reg(nor,
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/spi_nor_scan +3394 drivers/mtd/spi-nor/core.c

  3393	
> 3394	static int spi_nor_scan(struct spi_nor *nor, const char *name,
  3395				const struct spi_nor_hwcaps *hwcaps)
  3396	{
  3397		const struct flash_info *info;
  3398		struct device *dev = nor->dev;
  3399		int ret;
  3400	
  3401		/* Reset SPI protocol for all commands. */
  3402		nor->reg_proto = SNOR_PROTO_1_1_1;
  3403		nor->read_proto = SNOR_PROTO_1_1_1;
  3404		nor->write_proto = SNOR_PROTO_1_1_1;
  3405	
  3406		/*
  3407		 * We need the bounce buffer early to read/write registers when going
  3408		 * through the spi-mem layer (buffers have to be DMA-able).
  3409		 * For spi-mem drivers, we'll reallocate a new buffer if
  3410		 * nor->params->page_size turns out to be greater than PAGE_SIZE (which
  3411		 * shouldn't happen before long since NOR pages are usually less
  3412		 * than 1KB) after spi_nor_scan() returns.
  3413		 */
  3414		nor->bouncebuf_size = PAGE_SIZE;
  3415		nor->bouncebuf = devm_kmalloc(dev, nor->bouncebuf_size,
  3416					      GFP_KERNEL);
  3417		if (!nor->bouncebuf)
  3418			return -ENOMEM;
  3419	
  3420		ret = spi_nor_hw_reset(nor);
  3421		if (ret)
  3422			return ret;
  3423	
  3424		info = spi_nor_get_flash_info(nor, name);
  3425		if (IS_ERR(info))
  3426			return PTR_ERR(info);
  3427	
  3428		nor->info = info;
  3429	
  3430		mutex_init(&nor->lock);
  3431	
  3432		/* Init flash parameters based on flash_info struct and SFDP */
  3433		ret = spi_nor_init_params(nor);
  3434		if (ret)
  3435			return ret;
  3436	
  3437		if (spi_nor_use_parallel_locking(nor))
  3438			init_waitqueue_head(&nor->rww.wait);
  3439	
  3440		/*
  3441		 * Configure the SPI memory:
  3442		 * - select op codes for (Fast) Read, Page Program and Sector Erase.
  3443		 * - set the number of dummy cycles (mode cycles + wait states).
  3444		 * - set the SPI protocols for register and memory accesses.
  3445		 * - set the number of address bytes.
  3446		 */
  3447		ret = spi_nor_setup(nor, hwcaps);
  3448		if (ret)
  3449			return ret;
  3450	
  3451		/* Send all the required SPI flash commands to initialize device */
  3452		ret = spi_nor_init(nor);
  3453		if (ret)
  3454			return ret;
  3455	
  3456		/* No mtd_info fields should be used up to this point. */
  3457		ret = spi_nor_set_mtd_info(nor);
  3458		if (ret)
  3459			return ret;
  3460	
  3461		dev_dbg(dev, "Manufacturer and device ID: %*phN\n",
  3462			SPI_NOR_MAX_ID_LEN, nor->id);
  3463	
  3464		return 0;
  3465	}
  3466	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



More information about the linux-arm-kernel mailing list