Re: [PATCH 2/2] leds: pca995x: Add support for PCA995X chips

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

 



Hi Marek,

kernel test robot noticed the following build warnings:

[auto build test WARNING on lee-leds/for-leds-next]
[also build test WARNING on krzk-dt/for-next pavel-leds/for-next linus/master v6.4 next-20230704]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Marek-Vasut/leds-pca995x-Add-support-for-PCA995X-chips/20230705-043046
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link:    https://lore.kernel.org/r/20230704202843.91867-2-marex%40denx.de
patch subject: [PATCH 2/2] leds: pca995x: Add support for PCA995X chips
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20230705/202307050752.XBy4Li9L-lkp@xxxxxxxxx/config)
compiler: sparc64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230705/202307050752.XBy4Li9L-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307050752.XBy4Li9L-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/leds/leds-pca995x.c: In function 'pca995x_probe':
>> drivers/leds/leds-pca995x.c:103:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     103 |         btype = (int)device_get_match_data(&client->dev);
         |                 ^
   drivers/leds/leds-pca995x.c: At top level:
   drivers/leds/leds-pca995x.c:190:18: error: initialization of 'int (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *, const struct i2c_device_id *)' [-Werror=incompatible-pointer-types]
     190 |         .probe = pca995x_probe,
         |                  ^~~~~~~~~~~~~
   drivers/leds/leds-pca995x.c:190:18: note: (near initialization for 'pca995x_driver.<anonymous>.probe')
   cc1: some warnings being treated as errors


vim +103 drivers/leds/leds-pca995x.c

    93	
    94	static int pca995x_probe(struct i2c_client *client, const struct i2c_device_id *id)
    95	{
    96		struct fwnode_handle *led_fwnodes[PCA995X_MAX_OUTPUTS] = { 0 };
    97		struct fwnode_handle *np, *child;
    98		struct device *dev = &client->dev;
    99		struct pca995x_chip *chip;
   100		struct pca995x_led *led;
   101		int i, btype, reg, ret;
   102	
 > 103		btype = (int)device_get_match_data(&client->dev);
   104	
   105		np = dev_fwnode(dev);
   106		if (!np)
   107			return -ENODEV;
   108	
   109		chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
   110		if (!chip)
   111			return -ENOMEM;
   112	
   113		chip->btype = btype;
   114		chip->regmap = devm_regmap_init_i2c(client, &pca995x_regmap);
   115		if (IS_ERR(chip->regmap))
   116			return PTR_ERR(chip->regmap);
   117	
   118		i2c_set_clientdata(client, chip);
   119	
   120		fwnode_for_each_available_child_node(np, child) {
   121			ret = fwnode_property_read_u32(child, "reg", &reg);
   122			if (ret) {
   123				fwnode_handle_put(child);
   124				return ret;
   125			}
   126	
   127			if (reg < 0 || reg >= PCA995X_MAX_OUTPUTS || led_fwnodes[reg]) {
   128				fwnode_handle_put(child);
   129				return -EINVAL;
   130			}
   131	
   132			led = &chip->leds[reg];
   133			led_fwnodes[reg] = child;
   134			led->chip = chip;
   135			led->led_no = reg;
   136			led->ldev.brightness_set_blocking = pca995x_brightness_set;
   137			led->ldev.max_brightness = 255;
   138		}
   139	
   140		for (i = 0; i < PCA995X_MAX_OUTPUTS; i++) {
   141			struct led_init_data init_data = {};
   142	
   143			if (!led_fwnodes[i])
   144				continue;
   145	
   146			init_data.fwnode = led_fwnodes[i];
   147	
   148			ret = devm_led_classdev_register_ext(dev,
   149							     &chip->leds[i].ldev,
   150							     &init_data);
   151			if (ret < 0) {
   152				fwnode_handle_put(child);
   153				return dev_err_probe(dev, ret,
   154						     "Could not register LED %s\n",
   155						     chip->leds[i].ldev.name);
   156			}
   157		}
   158	
   159		/* Disable LED all-call address and set normal mode */
   160		ret = regmap_write(chip->regmap, PCA995X_MODE1, PCA995X_MODE_1_CFG);
   161		if (ret)
   162			return ret;
   163	
   164		/* IREF Output current value for all LEDn outputs */
   165		return regmap_write(chip->regmap,
   166				    btype ? PCA9955B_IREFALL : PCA9952_IREFALL,
   167				    PCA995X_IREFALL_CFG);
   168	}
   169	

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



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

  Powered by Linux