[PATCH v11 5/5] leds: mt6360: Add LED driver for MT6360
kernel test robot
lkp at intel.com
Wed Dec 2 15:37:06 EST 2020
Hi Gene,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on pavel-linux-leds/for-next]
[also build test WARNING on robh/for-next linus/master v5.10-rc6 next-20201201]
[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/Gene-Chen/leds-mt6360-Add-LED-driver-for-MT6360/20201202-185224
base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: nds32-randconfig-r012-20201202 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.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://github.com/0day-ci/linux/commit/594faa6d4c2cea720cd53d19375000ab042bb5cb
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Gene-Chen/leds-mt6360-Add-LED-driver-for-MT6360/20201202-185224
git checkout 594faa6d4c2cea720cd53d19375000ab042bb5cb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from include/linux/leds.h:12,
from include/linux/led-class-flash.h:11,
from drivers/leds/leds-mt6360.c:8:
drivers/leds/leds-mt6360.c: In function 'mt6360_led_probe':
>> drivers/leds/leds-mt6360.c:724:23: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
724 | dev_err(&pdev->dev, "No child node or node count over max led number %lu\n", count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/leds/leds-mt6360.c:724:3: note: in expansion of macro 'dev_err'
724 | dev_err(&pdev->dev, "No child node or node count over max led number %lu\n", count);
| ^~~~~~~
drivers/leds/leds-mt6360.c:724:74: note: format string is defined here
724 | dev_err(&pdev->dev, "No child node or node count over max led number %lu\n", count);
| ~~^
| |
| long unsigned int
| %u
vim +724 drivers/leds/leds-mt6360.c
714
715 static int mt6360_led_probe(struct platform_device *pdev)
716 {
717 struct mt6360_priv *priv;
718 struct fwnode_handle *child;
719 size_t count;
720 int i = 0, ret;
721
722 count = device_get_child_node_count(&pdev->dev);
723 if (!count || count > MT6360_MAX_LEDS) {
> 724 dev_err(&pdev->dev, "No child node or node count over max led number %lu\n", count);
725 return -EINVAL;
726 }
727
728 priv = devm_kzalloc(&pdev->dev, struct_size(priv, leds, count), GFP_KERNEL);
729 if (!priv)
730 return -ENOMEM;
731
732 priv->leds_count = count;
733 priv->dev = &pdev->dev;
734 mutex_init(&priv->lock);
735
736 priv->regmap = dev_get_regmap(pdev->dev.parent, NULL);
737 if (!priv->regmap) {
738 dev_err(&pdev->dev, "Failed to get parent regmap\n");
739 return -ENODEV;
740 }
741
742 device_for_each_child_node(&pdev->dev, child) {
743 struct mt6360_led *led = priv->leds + i;
744 struct led_init_data init_data = { .fwnode = child, };
745 u32 reg, led_color;
746
747 ret = fwnode_property_read_u32(child, "color", &led_color);
748 if (ret)
749 goto out_flash_release;
750
751 if (led_color == LED_COLOR_ID_RGB || led_color == LED_COLOR_ID_MULTI)
752 reg = MT6360_VIRTUAL_MULTICOLOR;
753 else {
754 ret = fwnode_property_read_u32(child, "reg", ®);
755 if (ret)
756 goto out_flash_release;
757
758 if (reg >= MT6360_MAX_LEDS) {
759 ret = -EINVAL;
760 goto out_flash_release;
761 }
762 }
763
764 if (priv->leds_active & BIT(reg)) {
765 ret = -EINVAL;
766 goto out_flash_release;
767 }
768 priv->leds_active |= BIT(reg);
769
770 led->led_no = reg;
771 led->priv = priv;
772
773 ret = mt6360_init_common_properties(led, &init_data);
774 if (ret)
775 goto out_flash_release;
776
777 if (reg == MT6360_VIRTUAL_MULTICOLOR ||
778 (reg >= MT6360_LED_ISNK1 && reg <= MT6360_LED_ISNKML))
779 ret = mt6360_init_isnk_properties(led, &init_data);
780 else
781 ret = mt6360_init_flash_properties(led, &init_data);
782
783 if (ret)
784 goto out_flash_release;
785
786 ret = mt6360_led_register(&pdev->dev, led, &init_data);
787 if (ret)
788 goto out_flash_release;
789
790 i++;
791 }
792
793 platform_set_drvdata(pdev, priv);
794 return 0;
795
796 out_flash_release:
797 mt6360_v4l2_flash_release(priv);
798 return ret;
799 }
800
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 32212 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20201203/a9d2ed35/attachment-0001.gz>
More information about the linux-arm-kernel
mailing list