[linux-next:master 891/7393] drivers/macintosh/ams/ams-i2c.c:74:27: error: initialization of 'void (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *)'

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   6ce5d01e7011b32600656bf90a626b1e51fb192a
commit: ed5c2f5fd10dda07263f79f338a512c0f49f76f5 [891/7393] i2c: Make remove callback return void
config: powerpc-buildonly-randconfig-r003-20220915 (https://download.01.org/0day-ci/archive/20220916/202209161552.cVmfMdfo-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ed5c2f5fd10dda07263f79f338a512c0f49f76f5
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout ed5c2f5fd10dda07263f79f338a512c0f49f76f5
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/macintosh/ams/

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

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

>> drivers/macintosh/ams/ams-i2c.c:74:27: error: initialization of 'void (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *)' [-Werror=incompatible-pointer-types]
      74 |         .remove         = ams_i2c_remove,
         |                           ^~~~~~~~~~~~~~
   drivers/macintosh/ams/ams-i2c.c:74:27: note: (near initialization for 'ams_i2c_driver.remove')
>> drivers/macintosh/ams/ams-i2c.c:233:13: error: conflicting types for 'ams_i2c_remove'; have 'void(struct i2c_client *)'
     233 | static void ams_i2c_remove(struct i2c_client *client)
         |             ^~~~~~~~~~~~~~
   drivers/macintosh/ams/ams-i2c.c:61:12: note: previous declaration of 'ams_i2c_remove' with type 'int(struct i2c_client *)'
      61 | static int ams_i2c_remove(struct i2c_client *client);
         |            ^~~~~~~~~~~~~~
>> drivers/macintosh/ams/ams-i2c.c:61:12: warning: 'ams_i2c_remove' used but never defined
   drivers/macintosh/ams/ams-i2c.c:233:13: warning: 'ams_i2c_remove' defined but not used [-Wunused-function]
     233 | static void ams_i2c_remove(struct i2c_client *client)
         |             ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +74 drivers/macintosh/ams/ams-i2c.c

dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   58  
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   59  static int ams_i2c_probe(struct i2c_client *client,
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   60  			 const struct i2c_device_id *id);
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17  @61  static int ams_i2c_remove(struct i2c_client *client);
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   62  
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   63  static const struct i2c_device_id ams_id[] = {
81e5d8646ff6bf drivers/macintosh/ams/ams-i2c.c Benjamin Herrenschmidt 2012-04-18   64  	{ "MAC,accelerometer_1", 0 },
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   65  	{ }
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   66  };
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   67  MODULE_DEVICE_TABLE(i2c, ams_id);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   68  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   69  static struct i2c_driver ams_i2c_driver = {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   70  	.driver = {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   71  		.name   = "ams",
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   72  	},
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   73  	.probe          = ams_i2c_probe,
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17  @74  	.remove         = ams_i2c_remove,
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   75  	.id_table       = ams_id,
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   76  };
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   77  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   78  static s32 ams_i2c_read(u8 reg)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   79  {
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   80  	return i2c_smbus_read_byte_data(ams_info.i2c_client, reg);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   81  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   82  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   83  static int ams_i2c_write(u8 reg, u8 value)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   84  {
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17   85  	return i2c_smbus_write_byte_data(ams_info.i2c_client, reg, value);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   86  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   87  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   88  static int ams_i2c_cmd(enum ams_i2c_cmd cmd)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   89  {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   90  	s32 result;
63232dcd555d60 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2007-05-08   91  	int count = 3;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   92  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   93  	ams_i2c_write(AMS_COMMAND, cmd);
63232dcd555d60 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2007-05-08   94  	msleep(5);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   95  
63232dcd555d60 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2007-05-08   96  	while (count--) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   97  		result = ams_i2c_read(AMS_COMMAND);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   98  		if (result == 0 || result & 0x80)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12   99  			return 0;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  100  
63232dcd555d60 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2007-05-08  101  		schedule_timeout_uninterruptible(HZ / 20);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  102  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  103  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  104  	return -1;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  105  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  106  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  107  static void ams_i2c_set_irq(enum ams_irq reg, char enable)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  108  {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  109  	if (reg & AMS_IRQ_FREEFALL) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  110  		u8 val = ams_i2c_read(AMS_CTRLX);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  111  		if (enable)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  112  			val |= 0x80;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  113  		else
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  114  			val &= ~0x80;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  115  		ams_i2c_write(AMS_CTRLX, val);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  116  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  117  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  118  	if (reg & AMS_IRQ_SHOCK) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  119  		u8 val = ams_i2c_read(AMS_CTRLY);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  120  		if (enable)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  121  			val |= 0x80;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  122  		else
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  123  			val &= ~0x80;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  124  		ams_i2c_write(AMS_CTRLY, val);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  125  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  126  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  127  	if (reg & AMS_IRQ_GLOBAL) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  128  		u8 val = ams_i2c_read(AMS_CTRLZ);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  129  		if (enable)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  130  			val |= 0x80;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  131  		else
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  132  			val &= ~0x80;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  133  		ams_i2c_write(AMS_CTRLZ, val);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  134  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  135  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  136  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  137  static void ams_i2c_clear_irq(enum ams_irq reg)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  138  {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  139  	if (reg & AMS_IRQ_FREEFALL)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  140  		ams_i2c_write(AMS_FREEFALL, 0);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  141  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  142  	if (reg & AMS_IRQ_SHOCK)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  143  		ams_i2c_write(AMS_SHOCK, 0);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  144  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  145  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  146  static u8 ams_i2c_get_vendor(void)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  147  {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  148  	return ams_i2c_read(AMS_VENDOR);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  149  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  150  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  151  static void ams_i2c_get_xyz(s8 *x, s8 *y, s8 *z)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  152  {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  153  	*x = ams_i2c_read(AMS_DATAX);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  154  	*y = ams_i2c_read(AMS_DATAY);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  155  	*z = ams_i2c_read(AMS_DATAZ);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  156  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  157  
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17  158  static int ams_i2c_probe(struct i2c_client *client,
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17  159  			 const struct i2c_device_id *id)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  160  {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  161  	int vmaj, vmin;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  162  	int result;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  163  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  164  	/* There can be only one */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  165  	if (unlikely(ams_info.has_device))
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  166  		return -ENODEV;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  167  
810ad7b62c0f07 drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2008-10-17  168  	ams_info.i2c_client = client;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  169  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  170  	if (ams_i2c_cmd(AMS_CMD_RESET)) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  171  		printk(KERN_INFO "ams: Failed to reset the device\n");
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  172  		return -ENODEV;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  173  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  174  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  175  	if (ams_i2c_cmd(AMS_CMD_START)) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  176  		printk(KERN_INFO "ams: Failed to start the device\n");
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  177  		return -ENODEV;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  178  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  179  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  180  	/* get version/vendor information */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  181  	ams_i2c_write(AMS_CTRL1, 0x02);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  182  	ams_i2c_write(AMS_CTRL2, 0x85);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  183  	ams_i2c_write(AMS_CTRL3, 0x01);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  184  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  185  	ams_i2c_cmd(AMS_CMD_READMEM);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  186  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  187  	vmaj = ams_i2c_read(AMS_DATA1);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  188  	vmin = ams_i2c_read(AMS_DATA2);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  189  	if (vmaj != 1 || vmin != 52) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  190  		printk(KERN_INFO "ams: Incorrect device version (%d.%d)\n",
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  191  			vmaj, vmin);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  192  		return -ENODEV;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  193  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  194  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  195  	ams_i2c_cmd(AMS_CMD_VERSION);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  196  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  197  	vmaj = ams_i2c_read(AMS_DATA1);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  198  	vmin = ams_i2c_read(AMS_DATA2);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  199  	if (vmaj != 0 || vmin != 1) {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  200  		printk(KERN_INFO "ams: Incorrect firmware version (%d.%d)\n",
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  201  			vmaj, vmin);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  202  		return -ENODEV;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  203  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  204  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  205  	/* Disable interrupts */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  206  	ams_i2c_set_irq(AMS_IRQ_ALL, 0);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  207  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  208  	result = ams_sensor_attach();
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  209  	if (result < 0)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  210  		return result;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  211  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  212  	/* Set default values */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  213  	ams_i2c_write(AMS_SENSLOW, 0x15);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  214  	ams_i2c_write(AMS_SENSHIGH, 0x60);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  215  	ams_i2c_write(AMS_CTRLX, 0x08);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  216  	ams_i2c_write(AMS_CTRLY, 0x0F);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  217  	ams_i2c_write(AMS_CTRLZ, 0x4F);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  218  	ams_i2c_write(AMS_UNKNOWN1, 0x14);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  219  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  220  	/* Clear interrupts */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  221  	ams_i2c_clear_irq(AMS_IRQ_ALL);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  222  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  223  	ams_info.has_device = 1;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  224  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  225  	/* Enable interrupts */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  226  	ams_i2c_set_irq(AMS_IRQ_ALL, 1);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  227  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  228  	printk(KERN_INFO "ams: Found I2C based motion sensor\n");
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  229  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  230  	return 0;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  231  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  232  
ed5c2f5fd10dda drivers/macintosh/ams/ams-i2c.c Uwe Kleine-König       2022-08-15 @233  static void ams_i2c_remove(struct i2c_client *client)
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  234  {
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  235  	if (ams_info.has_device) {
98ceb75c7c14ea drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2010-01-31  236  		ams_sensor_detach();
98ceb75c7c14ea drivers/hwmon/ams/ams-i2c.c     Jean Delvare           2010-01-31  237  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  238  		/* Disable interrupts */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  239  		ams_i2c_set_irq(AMS_IRQ_ALL, 0);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  240  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  241  		/* Clear interrupts */
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  242  		ams_i2c_clear_irq(AMS_IRQ_ALL);
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  243  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  244  		printk(KERN_INFO "ams: Unloading\n");
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  245  
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  246  		ams_info.has_device = 0;
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  247  	}
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  248  }
dcb69dd010c182 drivers/hwmon/ams/ams-i2c.c     Stelian Pop            2006-12-12  249  

:::::: The code at line 74 was first introduced by commit
:::::: 810ad7b62c0f075dc44ecc781b24c7f6ba388da5 hwmon: (ams) Convert to a new-style i2c driver

:::::: TO: Jean Delvare <khali@xxxxxxxxxxxx>
:::::: CC: Jean Delvare <khali@mahadeva.delvare>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux