[soc:board-remove 171/217] drivers/mfd/tc3589x.c:351:37: warning: unused variable 'id'

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all,org.infradead.lists.linux-arm-kernel
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git board-remove
head:   057394422bc04420585b2790b230d8a1f350ace8
commit: 9220687cca8bad538843ff5a1a062b10e008e238 [171/217] mfd: tc3589x: remove pdata based probing
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20260818/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260818/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   drivers/mfd/tc3589x.c: In function 'tc3589x_of_probe':
   drivers/mfd/tc3589x.c:335:24: error: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
     335 |                 return ERR_PTR(-ENODEV);
         |                        ^~~~~~~~~~~~~~~~
   drivers/mfd/tc3589x.c: In function 'tc3589x_probe':
>> drivers/mfd/tc3589x.c:351:37: warning: unused variable 'id' [-Wunused-variable]
     351 |         const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
         |                                     ^~


vim +/id +351 drivers/mfd/tc3589x.c

a435ae1d51e2f18 drivers/mfd/tc3589x.c Lee Jones        2012-09-07  348  
d28fa288ea50681 drivers/mfd/tc3589x.c Uwe Kleine-König 2022-11-18  349  static int tc3589x_probe(struct i2c_client *i2c)
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  350  {
d28fa288ea50681 drivers/mfd/tc3589x.c Uwe Kleine-König 2022-11-18 @351  	const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
a435ae1d51e2f18 drivers/mfd/tc3589x.c Lee Jones        2012-09-07  352  	struct device_node *np = i2c->dev.of_node;
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  353  	struct tc3589x *tc3589x;
a381b13e2aa0641 drivers/mfd/tc3589x.c Linus Walleij    2014-01-23  354  	enum tc3589x_version version;
9220687cca8bad5 drivers/mfd/tc3589x.c Arnd Bergmann    2026-08-07  355  	unsigned int block;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  356  	int ret;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  357  
9220687cca8bad5 drivers/mfd/tc3589x.c Arnd Bergmann    2026-08-07  358  	ret = tc3589x_of_probe(&i2c->dev, &version, &block);
9220687cca8bad5 drivers/mfd/tc3589x.c Arnd Bergmann    2026-08-07  359  	if (ret)
9220687cca8bad5 drivers/mfd/tc3589x.c Arnd Bergmann    2026-08-07  360  		return ret;
a435ae1d51e2f18 drivers/mfd/tc3589x.c Lee Jones        2012-09-07  361  
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  362  	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  363  				     | I2C_FUNC_SMBUS_I2C_BLOCK))
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  364  		return -EIO;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  365  
1383e00f79a7bd6 drivers/mfd/tc3589x.c Jingoo Han       2013-02-20  366  	tc3589x = devm_kzalloc(&i2c->dev, sizeof(struct tc3589x),
1383e00f79a7bd6 drivers/mfd/tc3589x.c Jingoo Han       2013-02-20  367  				GFP_KERNEL);
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  368  	if (!tc3589x)
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  369  		return -ENOMEM;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  370  
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  371  	mutex_init(&tc3589x->lock);
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  372  
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  373  	tc3589x->dev = &i2c->dev;
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  374  	tc3589x->i2c = i2c;
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  375  
a381b13e2aa0641 drivers/mfd/tc3589x.c Linus Walleij    2014-01-23  376  	switch (version) {
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  377  	case TC3589X_TC35893:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  378  	case TC3589X_TC35895:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  379  	case TC3589X_TC35896:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  380  		tc3589x->num_gpio = 20;
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  381  		break;
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  382  	case TC3589X_TC35890:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  383  	case TC3589X_TC35892:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  384  	case TC3589X_TC35894:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  385  	case TC3589X_UNKNOWN:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  386  	default:
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  387  		tc3589x->num_gpio = 24;
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  388  		break;
e64c1eb47352d62 drivers/mfd/tc3589x.c Linus Walleij    2013-10-18  389  	}
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  390  
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  391  	i2c_set_clientdata(i2c, tc3589x);
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  392  
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  393  	ret = tc3589x_chip_init(tc3589x);
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  394  	if (ret)
1383e00f79a7bd6 drivers/mfd/tc3589x.c Jingoo Han       2013-02-20  395  		return ret;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  396  
a435ae1d51e2f18 drivers/mfd/tc3589x.c Lee Jones        2012-09-07  397  	ret = tc3589x_irq_init(tc3589x, np);
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  398  	if (ret)
1383e00f79a7bd6 drivers/mfd/tc3589x.c Jingoo Han       2013-02-20  399  		return ret;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  400  
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  401  	ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  402  				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  403  				   "tc3589x", tc3589x);
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  404  	if (ret) {
20406ebff4a298e drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  405  		dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret);
1383e00f79a7bd6 drivers/mfd/tc3589x.c Jingoo Han       2013-02-20  406  		return ret;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  407  	}
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  408  
9220687cca8bad5 drivers/mfd/tc3589x.c Arnd Bergmann    2026-08-07  409  	ret = tc3589x_device_init(tc3589x, block);
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  410  	if (ret) {
611b7590afa6e6c drivers/mfd/tc3589x.c Sundar Iyer      2010-12-13  411  		dev_err(tc3589x->dev, "failed to add child devices\n");
1383e00f79a7bd6 drivers/mfd/tc3589x.c Jingoo Han       2013-02-20  412  		return ret;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  413  	}
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  414  
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  415  	return 0;
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  416  }
b4ecd326b789f10 drivers/mfd/tc35892.c Rabin Vincent    2010-05-10  417  

:::::: The code at line 351 was first introduced by commit
:::::: d28fa288ea506812ef73980b8c3dc9c39ec8c18b mfd: tc3589x: Convert to i2c's .probe_new()

:::::: TO: Uwe Kleine-König <[email protected]>
:::::: CC: Lee Jones <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.