[soc:board-remove 154/217] drivers/mfd/max8925-i2c.c:146:9: error: 'ret' undeclared; did you mean 'net'?

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: a4e72f5a88a6efa6a9edbb7e22c08bb45fd91940 [154/217] mfd: max8925: remove platform data probing
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20260817/[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/20260817/[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 errors (new ones prefixed by >>):

   drivers/mfd/max8925-i2c.c: In function 'max8925_probe':
>> drivers/mfd/max8925-i2c.c:146:9: error: 'ret' undeclared (first use in this function); did you mean 'net'?
     146 |         ret = of_property_read_u32(np, "maxim,tsc-irq", &chip->tsc_irq);
         |         ^~~
         |         net
   drivers/mfd/max8925-i2c.c:146:9: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/mfd/max8925-i2c.c:146:36: error: 'np' undeclared (first use in this function); did you mean 'up'?
     146 |         ret = of_property_read_u32(np, "maxim,tsc-irq", &chip->tsc_irq);
         |                                    ^~
         |                                    up
   In file included from include/linux/device.h:15,
                    from include/linux/platform_device.h:13,
                    from drivers/mfd/max8925-i2c.c:10:
>> drivers/mfd/max8925-i2c.c:148:25: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
     148 |                 dev_err(dev, "Not found maxim,tsc-irq property\n");
         |                         ^~~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/mfd/max8925-i2c.c:148:17: note: in expansion of macro 'dev_err'
     148 |                 dev_err(dev, "Not found maxim,tsc-irq property\n");
         |                 ^~~~~~~
   drivers/mfd/max8925-i2c.c:137:29: warning: unused variable 'node' [-Wunused-variable]
     137 |         struct device_node *node = client->dev.of_node;
         |                             ^~~~


vim +146 drivers/mfd/max8925-i2c.c

   133	
   134	static int max8925_probe(struct i2c_client *client)
   135	{
   136		struct max8925_chip *chip;
   137		struct device_node *node = client->dev.of_node;
   138		int tsc_irq;
   139	
   140		chip = devm_kzalloc(&client->dev,
   141				    sizeof(struct max8925_chip), GFP_KERNEL);
   142		if (chip == NULL)
   143			return -ENOMEM;
   144	
   145		/* parse DT to get platform data */
 > 146		ret = of_property_read_u32(np, "maxim,tsc-irq", &chip->tsc_irq);
   147		if (ret) {
 > 148			dev_err(dev, "Not found maxim,tsc-irq property\n");
   149			return -EINVAL;
   150		}
   151	
   152		chip->i2c = client;
   153		chip->dev = &client->dev;
   154		i2c_set_clientdata(client, chip);
   155		mutex_init(&chip->io_lock);
   156	
   157		chip->rtc = i2c_new_dummy_device(chip->i2c->adapter, RTC_I2C_ADDR);
   158		if (IS_ERR(chip->rtc)) {
   159			dev_err(chip->dev, "Failed to allocate I2C device for RTC\n");
   160			return PTR_ERR(chip->rtc);
   161		}
   162		i2c_set_clientdata(chip->rtc, chip);
   163	
   164		chip->adc = i2c_new_dummy_device(chip->i2c->adapter, ADC_I2C_ADDR);
   165		if (IS_ERR(chip->adc)) {
   166			dev_err(chip->dev, "Failed to allocate I2C device for ADC\n");
   167			i2c_unregister_device(chip->rtc);
   168			return PTR_ERR(chip->adc);
   169		}
   170		i2c_set_clientdata(chip->adc, chip);
   171	
   172		device_init_wakeup(&client->dev, 1);
   173	
   174		max8925_device_init(chip, tsc_irq);
   175	
   176		return 0;
   177	}
   178	

--
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.