From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH leds v1 03/10] leds: lm3697: use struct led_init_data when registering
Date: Thu, 17 Sep 2020 11:45:36 +0800 [thread overview]
Message-ID: <202009171155.FOkaoyQk%lkp@intel.com> (raw)
In-Reply-To: <20200916231650.11484-4-marek.behun@nic.cz>
[-- Attachment #1: Type: text/plain, Size: 5514 bytes --]
Hi "Marek,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on pavel-linux-leds/for-next]
[also build test WARNING on linus/master v5.9-rc5 next-20200916]
[cannot apply to linux/master j.anaszewski-leds/for-next]
[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/Marek-Beh-n/Start-moving-parsing-of-linux-default-trigger-to-LED-core-a-cleanup-of-LED-drivers/20200917-071924
base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/leds/leds-lm3697.c: In function 'lm3697_probe_dt':
>> drivers/leds/leds-lm3697.c:216:24: warning: variable 'init_data' set but not used [-Wunused-but-set-variable]
216 | struct led_init_data init_data = {};
| ^~~~~~~~~
# https://github.com/0day-ci/linux/commit/7ce949fcd35468fa30bf6e5c0053ffe43319496e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Beh-n/Start-moving-parsing-of-linux-default-trigger-to-LED-core-a-cleanup-of-LED-drivers/20200917-071924
git checkout 7ce949fcd35468fa30bf6e5c0053ffe43319496e
vim +/init_data +216 drivers/leds/leds-lm3697.c
192
193 static int lm3697_probe_dt(struct lm3697 *priv)
194 {
195 struct fwnode_handle *child = NULL;
196 struct lm3697_led *led;
197 int control_bank;
198 size_t i = 0;
199 int ret = -EINVAL;
200 int j;
201
202 priv->enable_gpio = devm_gpiod_get_optional(&priv->client->dev,
203 "enable", GPIOD_OUT_LOW);
204 if (IS_ERR(priv->enable_gpio)) {
205 ret = PTR_ERR(priv->enable_gpio);
206 dev_err(&priv->client->dev, "Failed to get enable gpio: %d\n",
207 ret);
208 return ret;
209 }
210
211 priv->regulator = devm_regulator_get(&priv->client->dev, "vled");
212 if (IS_ERR(priv->regulator))
213 priv->regulator = NULL;
214
215 device_for_each_child_node(priv->dev, child) {
> 216 struct led_init_data init_data = {};
217
218 ret = fwnode_property_read_u32(child, "reg", &control_bank);
219 if (ret) {
220 dev_err(&priv->client->dev, "reg property missing\n");
221 fwnode_handle_put(child);
222 goto child_out;
223 }
224
225 if (control_bank > LM3697_CONTROL_B) {
226 dev_err(&priv->client->dev, "reg property is invalid\n");
227 ret = -EINVAL;
228 fwnode_handle_put(child);
229 goto child_out;
230 }
231
232 led = &priv->leds[i];
233
234 ret = ti_lmu_common_get_brt_res(&priv->client->dev,
235 child, &led->lmu_data);
236 if (ret)
237 dev_warn(&priv->client->dev, "brightness resolution property missing\n");
238
239 led->control_bank = control_bank;
240 led->lmu_data.regmap = priv->regmap;
241 led->lmu_data.runtime_ramp_reg = LM3697_CTRL_A_RAMP +
242 control_bank;
243 led->lmu_data.msb_brightness_reg = LM3697_CTRL_A_BRT_MSB +
244 led->control_bank * 2;
245 led->lmu_data.lsb_brightness_reg = LM3697_CTRL_A_BRT_LSB +
246 led->control_bank * 2;
247
248 led->num_leds = fwnode_property_count_u32(child, "led-sources");
249 if (led->num_leds > LM3697_MAX_LED_STRINGS) {
250 dev_err(&priv->client->dev, "Too many LED strings defined\n");
251 continue;
252 }
253
254 ret = fwnode_property_read_u32_array(child, "led-sources",
255 led->hvled_strings,
256 led->num_leds);
257 if (ret) {
258 dev_err(&priv->client->dev, "led-sources property missing\n");
259 fwnode_handle_put(child);
260 goto child_out;
261 }
262
263 for (j = 0; j < led->num_leds; j++)
264 priv->bank_cfg |=
265 (led->control_bank << led->hvled_strings[j]);
266
267 ret = ti_lmu_common_get_ramp_params(&priv->client->dev,
268 child, &led->lmu_data);
269 if (ret)
270 dev_warn(&priv->client->dev, "runtime-ramp properties missing\n");
271
272 init_data.fwnode = child;
273 init_data.devicename = priv->client->name;
274 /* for backwards compatibility if `label` is not present */
275 init_data.default_label = ":";
276
277 led->priv = priv;
278 led->led_dev.max_brightness = led->lmu_data.max_brightness;
279 led->led_dev.brightness_set_blocking = lm3697_brightness_set;
280
281 ret = devm_led_classdev_register(priv->dev, &led->led_dev);
282 if (ret) {
283 dev_err(&priv->client->dev, "led register err: %d\n",
284 ret);
285 fwnode_handle_put(child);
286 goto child_out;
287 }
288
289 i++;
290 }
291
292 child_out:
293 return ret;
294 }
295
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 75891 bytes --]
next prev parent reply other threads:[~2020-09-17 3:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 23:16 [PATCH leds v1 00/10] Start moving parsing of `linux,default-trigger` to LED core (a cleanup of LED drivers) Marek Behún
2020-09-16 23:16 ` [PATCH leds v1 01/10] leds: parse linux,default-trigger DT property in LED core Marek Behún
2020-09-16 23:16 ` [PATCH leds v1 02/10] leds: bcm6328, bcm6358: use struct led_init_data when registering Marek Behún
2020-09-16 23:16 ` [PATCH leds v1 03/10] leds: lm3697: " Marek Behún
2020-09-17 3:45 ` kernel test robot [this message]
2020-09-17 11:39 ` Dan Murphy
2020-09-17 15:24 ` Marek Behun
2020-09-16 23:16 ` [PATCH leds v1 04/10] leds: max77650: " Marek Behún
2020-09-17 10:09 ` Bartosz Golaszewski
2020-09-16 23:16 ` [PATCH leds v1 05/10] leds: mt6323: " Marek Behún
2020-09-16 23:16 ` [PATCH leds v1 06/10] leds: pm8058: " Marek Behún
2020-09-17 0:46 ` Bjorn Andersson
2020-09-17 15:24 ` Marek Behun
2020-09-16 23:16 ` [PATCH leds v1 07/10] leds: is31fl32xx: " Marek Behún
2020-09-17 15:23 ` Marek Behun
2020-09-16 23:16 ` [PATCH leds v1 08/10] leds: is31fl319x: " Marek Behún
2020-09-16 23:16 ` [PATCH leds v1 09/10] leds: lm36274: " Marek Behún
2020-09-17 15:28 ` Dan Murphy
2020-09-17 15:54 ` Marek Behun
2020-09-16 23:16 ` [PATCH leds v1 10/10] leds: ns2: refactor and use struct led_init_data Marek Behún
2020-09-18 13:02 ` Simon Guinot
2020-09-18 17:14 ` Marek Behun
2020-09-21 12:53 ` Simon Guinot
2020-09-21 13:02 ` Marek Behun
2020-09-21 14:03 ` Simon Guinot
2020-09-21 14:31 ` Marek Behun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202009171155.FOkaoyQk%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.