tree: https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git led_naming_v3 head: 874afe7cdd93e3bf618b83f103985a965f4a23a8 commit: 300ff6071d0100653827e393853b9a52013e9804 [13/37] leds: class: Improve LED and LED flash class registration API reproduce: # apt-get install sparse git checkout 300ff6071d0100653827e393853b9a52013e9804 make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' sparse warnings: (new ones prefixed by >>) drivers/leds/leds-pwm.c:117:15: sparse: undefined identifier 'devm_of_led_classdev_register' >> drivers/leds/leds-pwm.c:117:44: sparse: call with no type! vim +117 drivers/leds/leds-pwm.c 0f86815a Peter Ujfalusi 2012-12-21 76 5f7b03dc Russell King 2014-04-06 77 static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv, b795e6d9 Russell King 2014-04-06 78 struct led_pwm *led, struct device_node *child) 08541cbc Peter Ujfalusi 2012-12-21 79 { 5f7b03dc Russell King 2014-04-06 80 struct led_pwm_data *led_data = &priv->leds[priv->num_leds]; 1b50673d Boris Brezillon 2016-04-14 81 struct pwm_args pargs; aa1a6d6d Peter Ujfalusi 2013-11-28 82 int ret; 08541cbc Peter Ujfalusi 2012-12-21 83 5f7b03dc Russell King 2014-04-06 84 led_data->active_low = led->active_low; 5f7b03dc Russell King 2014-04-06 85 led_data->cdev.name = led->name; 5f7b03dc Russell King 2014-04-06 86 led_data->cdev.default_trigger = led->default_trigger; 5f7b03dc Russell King 2014-04-06 87 led_data->cdev.brightness = LED_OFF; 5f7b03dc Russell King 2014-04-06 88 led_data->cdev.max_brightness = led->max_brightness; 5f7b03dc Russell King 2014-04-06 89 led_data->cdev.flags = LED_CORE_SUSPENDRESUME; 5f7b03dc Russell King 2014-04-06 90 b795e6d9 Russell King 2014-04-06 91 if (child) b795e6d9 Russell King 2014-04-06 92 led_data->pwm = devm_of_pwm_get(dev, child, NULL); b795e6d9 Russell King 2014-04-06 93 else 5f7b03dc Russell King 2014-04-06 94 led_data->pwm = devm_pwm_get(dev, led->name); 5f7b03dc Russell King 2014-04-06 95 if (IS_ERR(led_data->pwm)) { 5f7b03dc Russell King 2014-04-06 96 ret = PTR_ERR(led_data->pwm); 9aec3037 Jerome Brunet 2018-09-06 97 if (ret != -EPROBE_DEFER) 5f7b03dc Russell King 2014-04-06 98 dev_err(dev, "unable to request PWM for %s: %d\n", 5f7b03dc Russell King 2014-04-06 99 led->name, ret); 5f7b03dc Russell King 2014-04-06 100 return ret; 5f7b03dc Russell King 2014-04-06 101 } 5f7b03dc Russell King 2014-04-06 102 247bde13 Thierry Reding 2017-01-04 103 led_data->cdev.brightness_set_blocking = led_pwm_set; 5f7b03dc Russell King 2014-04-06 104 1b50673d Boris Brezillon 2016-04-14 105 /* 1b50673d Boris Brezillon 2016-04-14 106 * FIXME: pwm_apply_args() should be removed when switching to the 1b50673d Boris Brezillon 2016-04-14 107 * atomic PWM API. 1b50673d Boris Brezillon 2016-04-14 108 */ 1b50673d Boris Brezillon 2016-04-14 109 pwm_apply_args(led_data->pwm); 1b50673d Boris Brezillon 2016-04-14 110 1b50673d Boris Brezillon 2016-04-14 111 pwm_get_args(led_data->pwm, &pargs); 1b50673d Boris Brezillon 2016-04-14 112 1b50673d Boris Brezillon 2016-04-14 113 led_data->period = pargs.period; 7c574cf6 Linus Torvalds 2014-06-12 114 if (!led_data->period && (led->pwm_period_ns > 0)) 7c574cf6 Linus Torvalds 2014-06-12 115 led_data->period = led->pwm_period_ns; 08541cbc Peter Ujfalusi 2012-12-21 116 cb14e6d6 Krzysztof Kozlowski 2018-12-07 @117 ret = devm_of_led_classdev_register(dev, child, &led_data->cdev); 5f7b03dc Russell King 2014-04-06 118 if (ret == 0) { 5f7b03dc Russell King 2014-04-06 119 priv->num_leds++; f1670336 Markus Hofstaetter 2015-11-11 120 led_pwm_set(&led_data->cdev, led_data->cdev.brightness); 5f7b03dc Russell King 2014-04-06 121 } else { 5f7b03dc Russell King 2014-04-06 122 dev_err(dev, "failed to register PWM led for %s: %d\n", 5f7b03dc Russell King 2014-04-06 123 led->name, ret); 5f7b03dc Russell King 2014-04-06 124 } 08541cbc Peter Ujfalusi 2012-12-21 125 5f7b03dc Russell King 2014-04-06 126 return ret; 08541cbc Peter Ujfalusi 2012-12-21 127 } 08541cbc Peter Ujfalusi 2012-12-21 128 :::::: The code at line 117 was first introduced by commit :::::: cb14e6d6d8f411b7a05f36d1f877450c036d8c56 leds: pwm: Use OF variant of LED registering function :::::: TO: Krzysztof Kozlowski <krzk@xxxxxxxxxx> :::::: CC: Jacek Anaszewski <jacek.anaszewski@xxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation