Re: [PATCH] platform/chrome: cros_kbd_led_backlight: enable probing through EC_FEATURE_PWM_KEYB

kernel test robot
2024-05-05T22:33:47Z

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on 2fbe479c0024e1c6b992184a799055e19932aa48]

url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/platform-chrome-cros_kbd_led_backlight-enable-probing-through-EC_FEATURE_PWM_KEYB/20240505-174413
base: 2fbe479c0024e1c6b992184a799055e19932aa48
patch link: https://lore.kernel.org/r/20240505-cros_ec-kbd-led-framework-v1-1-bfcca69013d2%40weissschuh.net
patch subject: [PATCH] platform/chrome: cros_kbd_led_backlight: enable probing through EC_FEATURE_PWM_KEYB
config: x86_64-randconfig-072-20240506 (https://download.01.org/0day-ci/archive/20240506/202405060655.dD06crN0-lkp@intel.com/config)
compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240506/202405060655.dD06crN0-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405060655.dD06crN0-lkp@intel.com/

All errors (new ones prefixed by >>):

drivers/platform/chrome/cros_kbd_led_backlight.c:218:42: error: redefinition of 'keyboard_led_drvdata_ec_pwm'
218 | static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {};
| ^
drivers/platform/chrome/cros_kbd_led_backlight.c:184:57: note: previous definition is here
184 | static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {
| ^
>> drivers/platform/chrome/cros_kbd_led_backlight.c:240:14: error: use of undeclared identifier 'keyboard_led_drvdata_ec_pwm_mfd'; did you mean 'keyboard_led_drvdata_acpi'?
240 | drvdata = &keyboard_led_drvdata_ec_pwm_mfd;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| keyboard_led_drvdata_acpi
drivers/platform/chrome/cros_kbd_led_backlight.c:114:42: note: 'keyboard_led_drvdata_acpi' declared here
114 | static const struct keyboard_led_drvdata keyboard_led_drvdata_acpi = {
| ^
2 errors generated.

vim +240 drivers/platform/chrome/cros_kbd_led_backlight.c

217
> 218 static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {};
219
220 #endif /* IS_ENABLED(CONFIG_MFD_CROS_EC_DEV) */
221
222 static int keyboard_led_is_mfd_device(struct platform_device *pdev)
223 {
224 if (!IS_ENABLED(CONFIG_MFD_CROS_EC_DEV))
225 return 0;
226
227 if (!pdev->dev.parent)
228 return 0;
229
230 return strcmp(pdev->dev.parent->driver->name, "cros-ec-dev") == 0;
231 }
232
233 static int keyboard_led_probe(struct platform_device *pdev)
234 {
235 const struct keyboard_led_drvdata *drvdata;
236 struct keyboard_led *keyboard_led;
237 int error;
238
239 if (keyboard_led_is_mfd_device(pdev))
> 240 drvdata = &keyboard_led_drvdata_ec_pwm_mfd;
241 else
242 drvdata = device_get_match_data(&pdev->dev);
243 if (!drvdata)
244 return -EINVAL;
245
246 keyboard_led = devm_kzalloc(&pdev->dev, sizeof(*keyboard_led), GFP_KERNEL);
247 if (!keyboard_led)
248 return -ENOMEM;
249 platform_set_drvdata(pdev, keyboard_led);
250
251 if (drvdata->init) {
252 error = drvdata->init(pdev);
253 if (error)
254 return error;
255 }
256
257 keyboard_led->cdev.name = "chromeos::kbd_backlight";
258 keyboard_led->cdev.flags |= LED_CORE_SUSPENDRESUME;
259 keyboard_led->cdev.max_brightness = drvdata->max_brightness;
260 keyboard_led->cdev.brightness_set = drvdata->brightness_set;
261 keyboard_led->cdev.brightness_set_blocking = drvdata->brightness_set_blocking;
262 keyboard_led->cdev.brightness_get = drvdata->brightness_get;
263
264 error = devm_led_classdev_register(&pdev->dev, &keyboard_led->cdev);
265 if (error)
266 return error;
267
268 return 0;
269 }
270

--
0-DAY CI Kernel Test Service