Re: [PATCH v2 1/4] ALSA: hda/cirrus: Add error handling into CS8409 I2C functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vitaly,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on sound/for-next]
[also build test WARNING on next-20210315]
[cannot apply to v5.12-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vitaly-Rodionov/ALSA-hda-cirrus-Make-CS8409-driver-more-generic-by-using-fixups/20210316-010109
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: i386-randconfig-s002-20210315 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-277-gc089cd2d-dirty
        # https://github.com/0day-ci/linux/commit/649ba4016100c8793c314c9dd5213ea910a70ffd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vitaly-Rodionov/ALSA-hda-cirrus-Make-CS8409-driver-more-generic-by-using-fixups/20210316-010109
        git checkout 649ba4016100c8793c314c9dd5213ea910a70ffd
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> sound/pci/hda/patch_cirrus.c:1600: warning: expecting prototype for cs8409_i2c_read(). Prototype was for cs8409_i2c_write() instead


vim +1600 sound/pci/hda/patch_cirrus.c

6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1584  
649ba4016100c8 Stefan Binding  2021-03-15  1585  /**
649ba4016100c8 Stefan Binding  2021-03-15  1586   * cs8409_i2c_read - CS8409 I2C Write.
649ba4016100c8 Stefan Binding  2021-03-15  1587   * @codec: the codec instance
649ba4016100c8 Stefan Binding  2021-03-15  1588   * @i2c_address: I2C Address
649ba4016100c8 Stefan Binding  2021-03-15  1589   * @i2c_reg: Register to write to
649ba4016100c8 Stefan Binding  2021-03-15  1590   * @i2c_data: Data to write
649ba4016100c8 Stefan Binding  2021-03-15  1591   * @paged: Is a paged transaction
649ba4016100c8 Stefan Binding  2021-03-15  1592   *
649ba4016100c8 Stefan Binding  2021-03-15  1593   * CS8409 I2C Write.
649ba4016100c8 Stefan Binding  2021-03-15  1594   * Returns negative on error, otherwise returns 0.
649ba4016100c8 Stefan Binding  2021-03-15  1595   */
649ba4016100c8 Stefan Binding  2021-03-15  1596  static int cs8409_i2c_write(struct hda_codec *codec,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1597  		unsigned int i2c_address, unsigned int i2c_reg,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1598  		unsigned int i2c_data,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1599  		unsigned int paged)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06 @1600  {
649ba4016100c8 Stefan Binding  2021-03-15  1601  	unsigned int i2c_reg_data;
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1602  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1603  	cs8409_enable_i2c_clock(codec, 1);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1604  	cs_vendor_coef_set(codec, CIR_I2C_ADDR, i2c_address);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1605  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1606  	if (paged) {
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1607  		cs_vendor_coef_set(codec, CIR_I2C_QWRITE, i2c_reg >> 8);
649ba4016100c8 Stefan Binding  2021-03-15  1608  		if (cs8409_i2c_wait_complete(codec) < 0) {
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1609  			codec_err(codec,
649ba4016100c8 Stefan Binding  2021-03-15  1610  				"%s() Paged Transaction Failed 0x%02x : 0x%04x\n",
649ba4016100c8 Stefan Binding  2021-03-15  1611  				__func__, i2c_address, i2c_reg);
649ba4016100c8 Stefan Binding  2021-03-15  1612  			return -EIO;
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1613  		}
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1614  	}
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1615  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1616  	i2c_reg_data = ((i2c_reg << 8) & 0x0ff00) | (i2c_data & 0x0ff);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1617  	cs_vendor_coef_set(codec, CIR_I2C_QWRITE, i2c_reg_data);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1618  
649ba4016100c8 Stefan Binding  2021-03-15  1619  	if (cs8409_i2c_wait_complete(codec) < 0) {
649ba4016100c8 Stefan Binding  2021-03-15  1620  		codec_err(codec, "%s() Transaction Failed 0x%02x : 0x%04x\n",
649ba4016100c8 Stefan Binding  2021-03-15  1621  			__func__, i2c_address, i2c_reg);
649ba4016100c8 Stefan Binding  2021-03-15  1622  		return -EIO;
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1623  	}
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1624  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1625  	cs8409_enable_i2c_clock(codec, 0);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1626  
649ba4016100c8 Stefan Binding  2021-03-15  1627  	return 0;
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1628  }
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  1629  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux