Re: [PATCH v1 1/1] leds: syscon: Get rid of custom led_init_default_state_get()

kernel test robot
2022-08-03T00:55:52Z

Hi Andy,

I love your patch! Yet something to improve:

[auto build test ERROR on pavel-leds/for-next]
[also build test ERROR on linus/master v5.19 next-20220728]
[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/Andy-Shevchenko/leds-syscon-Get-rid-of-custom-led_init_default_state_get/20220803-052528
base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: hexagon-randconfig-r041-20220801 (https://download.01.org/0day-ci/archive/20220803/202208030858.VhHvPCPM-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 52cd00cabf479aa7eb6dbb063b7ba41ea57bce9e)
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/intel-lab-lkp/linux/commit/485abd71bd954b7a2d1ea89818ca5c925714b1e1
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/leds-syscon-Get-rid-of-custom-led_init_default_state_get/20220803-052528
git checkout 485abd71bd954b7a2d1ea89818ca5c925714b1e1
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/leds/

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

All errors (new ones prefixed by >>):

>> drivers/leds/leds-syscon.c:92:10: error: call to undeclared function 'led_init_default_state_get'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
state = led_init_default_state_get(init_data.fwnode);
^
1 error generated.

vim +/led_init_default_state_get +92 drivers/leds/leds-syscon.c

55
56 static int syscon_led_probe(struct platform_device *pdev)
57 {
58 struct led_init_data init_data = {};
59 struct device *dev = &pdev->dev;
60 struct device_node *np = dev_of_node(dev);
61 struct device *parent;
62 struct regmap *map;
63 struct syscon_led *sled;
64 enum led_default_state state;
65 u32 value;
66 int ret;
67
68 parent = dev->parent;
69 if (!parent) {
70 dev_err(dev, "no parent for syscon LED\n");
71 return -ENODEV;
72 }
73 map = syscon_node_to_regmap(dev_of_node(parent));
74 if (IS_ERR(map)) {
75 dev_err(dev, "no regmap for syscon LED parent\n");
76 return PTR_ERR(map);
77 }
78
79 sled = devm_kzalloc(dev, sizeof(*sled), GFP_KERNEL);
80 if (!sled)
81 return -ENOMEM;
82
83 sled->map = map;
84
85 if (of_property_read_u32(np, "offset", &sled->offset))
86 return -EINVAL;
87 if (of_property_read_u32(np, "mask", &sled->mask))
88 return -EINVAL;
89
90 init_data.fwnode = of_fwnode_handle(np);
91
> 92 state = led_init_default_state_get(init_data.fwnode);
93 switch (state) {
94 case LEDS_DEFSTATE_ON:
95 ret = regmap_update_bits(map, sled->offset, sled->mask, sled->mask);
96 if (ret < 0)
97 return ret;
98 sled->state = true;
99 break;
100 case LEDS_DEFSTATE_KEEP:
101 ret = regmap_read(map, sled->offset, &value);
102 if (ret < 0)
103 return ret;
104 sled->state = !!(value & sled->mask);
105 break;
106 default:
107 ret = regmap_update_bits(map, sled->offset, sled->mask, 0);
108 if (ret < 0)
109 return ret;
110 sled->state = false;
111 }
112 sled->cdev.brightness_set = syscon_led_set;
113
114 ret = devm_led_classdev_register_ext(dev, &sled->cdev, &init_data);
115 if (ret < 0)
116 return ret;
117
118 platform_set_drvdata(pdev, sled);
119 dev_info(dev, "registered LED %s\n", sled->cdev.name);
120
121 return 0;
122 }
123

--
0-DAY CI Kernel Test Service