All of lore.kernel.org
 help / color / mirror / Atom feed
* [bvanassche:thread-safety 272/460] sound/soc/codecs/cs35l56-shared.c:515:27: error: implicit declaration of function 'to_spi_device'; did you mean 'to_rtc_device'?
@ 2026-11-19  0:54 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-19  0:54 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: oe-kbuild-all

tree:   https://github.com/bvanassche/linux thread-safety
head:   754c0efaaee1c85b67fd7f8a45f7be89900b661f
commit: b92d6bdb8a97a9e35c1baf80d282833e714e75de [272/460] spi: Convert to_spi_device() into an inline function
config: nios2-randconfig-2200-20261118 (https://download.01.org/0day-ci/archive/20261119/20261119015135.HKvs0tsR-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 8.5.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261119/20261119015135.HKvs0tsR-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261119015135.HKvs0tsR-lkp@intel.com/

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

   In file included from sound/soc/codecs/cs35l56-shared.c:20:
   include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
    static inline struct spi_device *to_spi_device(struct device *dev)
    ^~~~~~
   include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
    static inline struct spi_device *to_spi_device(void *dev)
    ^~~~~~
   include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
    static inline const struct spi_device *to_spi_device(const struct device *dev)
    ^~~~~~
   sound/soc/codecs/cs35l56-shared.c: In function 'cs35l56_spi_system_reset':
>> sound/soc/codecs/cs35l56-shared.c:515:27: error: implicit declaration of function 'to_spi_device'; did you mean 'to_rtc_device'? [-Werror=implicit-function-declaration]
     struct spi_device *spi = to_spi_device(cs35l56_base->dev);
                              ^~~~~~~~~~~~~
                              to_rtc_device
>> sound/soc/codecs/cs35l56-shared.c:515:27: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   cc1: some warnings being treated as errors


vim +515 sound/soc/codecs/cs35l56-shared.c

769c1b79295c38 Richard Fitzgerald 2025-02-25  512  
769c1b79295c38 Richard Fitzgerald 2025-02-25  513  static void cs35l56_spi_system_reset(struct cs35l56_base *cs35l56_base)
769c1b79295c38 Richard Fitzgerald 2025-02-25  514  {
769c1b79295c38 Richard Fitzgerald 2025-02-25 @515  	struct spi_device *spi = to_spi_device(cs35l56_base->dev);
769c1b79295c38 Richard Fitzgerald 2025-02-25  516  	unsigned int val;
769c1b79295c38 Richard Fitzgerald 2025-02-25  517  	int read_ret, ret;
769c1b79295c38 Richard Fitzgerald 2025-02-25  518  
769c1b79295c38 Richard Fitzgerald 2025-02-25  519  	/*
769c1b79295c38 Richard Fitzgerald 2025-02-25  520  	 * There must not be any other SPI bus activity while the amp is
769c1b79295c38 Richard Fitzgerald 2025-02-25  521  	 * soft-resetting.
769c1b79295c38 Richard Fitzgerald 2025-02-25  522  	 */
f7a7818d7c687b Bart Van Assche    2026-11-02  523  	spi_bus_lock(spi->controller);
769c1b79295c38 Richard Fitzgerald 2025-02-25  524  
769c1b79295c38 Richard Fitzgerald 2025-02-25  525  	cs35l56_spi_issue_bus_locked_reset(cs35l56_base, spi);
769c1b79295c38 Richard Fitzgerald 2025-02-25  526  	spi_bus_unlock(spi->controller);
769c1b79295c38 Richard Fitzgerald 2025-02-25  527  
769c1b79295c38 Richard Fitzgerald 2025-02-25  528  	/*
769c1b79295c38 Richard Fitzgerald 2025-02-25  529  	 * Check firmware boot by testing for a response in MBOX_2.
769c1b79295c38 Richard Fitzgerald 2025-02-25  530  	 * HALO_STATE cannot be trusted yet because the reset sequence
769c1b79295c38 Richard Fitzgerald 2025-02-25  531  	 * can leave it with stale state. But MBOX is reset.
769c1b79295c38 Richard Fitzgerald 2025-02-25  532  	 * The regmap must remain in cache-only until the chip has
769c1b79295c38 Richard Fitzgerald 2025-02-25  533  	 * booted, so use a bypassed read.
769c1b79295c38 Richard Fitzgerald 2025-02-25  534  	 */
007699d278a655 Richard Fitzgerald 2026-06-11  535  	val = 0;
769c1b79295c38 Richard Fitzgerald 2025-02-25  536  	ret = read_poll_timeout(regmap_read_bypassed, read_ret,
769c1b79295c38 Richard Fitzgerald 2025-02-25  537  				(val > 0) && (val < 0xffffffff),
769c1b79295c38 Richard Fitzgerald 2025-02-25  538  				CS35L56_HALO_STATE_POLL_US,
769c1b79295c38 Richard Fitzgerald 2025-02-25  539  				CS35L56_HALO_STATE_TIMEOUT_US,
769c1b79295c38 Richard Fitzgerald 2025-02-25  540  				false,
769c1b79295c38 Richard Fitzgerald 2025-02-25  541  				cs35l56_base->regmap,
769c1b79295c38 Richard Fitzgerald 2025-02-25  542  				CS35L56_DSP_VIRTUAL1_MBOX_2,
769c1b79295c38 Richard Fitzgerald 2025-02-25  543  				&val);
769c1b79295c38 Richard Fitzgerald 2025-02-25  544  	if (ret) {
769c1b79295c38 Richard Fitzgerald 2025-02-25  545  		dev_err(cs35l56_base->dev, "SPI reboot timed out(%d): MBOX2=%#x\n",
769c1b79295c38 Richard Fitzgerald 2025-02-25  546  			read_ret, val);
769c1b79295c38 Richard Fitzgerald 2025-02-25  547  	}
769c1b79295c38 Richard Fitzgerald 2025-02-25  548  }
769c1b79295c38 Richard Fitzgerald 2025-02-25  549  

:::::: The code at line 515 was first introduced by commit
:::::: 769c1b79295c38d60fde4c0a8f5f31e01360c54f ASoC: cs35l56: Prevent races when soft-resetting using SPI control

:::::: TO: Richard Fitzgerald <rf@opensource.cirrus.com>
:::::: CC: Mark Brown <broonie@kernel.org>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19  0:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19  0:54 [bvanassche:thread-safety 272/460] sound/soc/codecs/cs35l56-shared.c:515:27: error: implicit declaration of function 'to_spi_device'; did you mean 'to_rtc_device'? kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.