linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: "Guido Günther" <agx@sigxcpu.org>
Cc: kbuild-all@lists.01.org, linux-leds@vger.kernel.org,
	Pavel <pavel@ucw.cz>
Subject: [pavel-linux-leds:for-next 19/21] drivers/leds/leds-lm3692x.c:413:61: error: 'max_cur' undeclared
Date: Mon, 6 Jan 2020 13:28:29 +0800	[thread overview]
Message-ID: <202001061327.thYBnJ8B%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4907 bytes --]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
head:   a1b13557cf7fb7248c5409078b7f58a2b1e04288
commit: ef791c4d0ce8c77ceb61a2e453d2a51cc5be478a [19/21] leds: lm3692x: Make sure we don't exceed the maximum LED current
config: i386-randconfig-a002-20200106 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        git checkout ef791c4d0ce8c77ceb61a2e453d2a51cc5be478a
        # save the attached .config to linux build tree
        make ARCH=i386 

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

All errors (new ones prefixed by >>):

   drivers/leds/leds-lm3692x.c: In function 'lm3692x_max_brightness':
   drivers/leds/leds-lm3692x.c:331:9: error: 'struct lm3692x_led' has no member named 'brightness_ctrl'
     if (led->brightness_ctrl & LM3692X_MAP_MODE_EXP) {
            ^
   drivers/leds/leds-lm3692x.c: In function 'lm3692x_probe_dt':
>> drivers/leds/leds-lm3692x.c:413:61: error: 'max_cur' undeclared (first use in this function)
     ret = fwnode_property_read_u32(child, "led-max-microamp", &max_cur);
                                                                ^
   drivers/leds/leds-lm3692x.c:413:61: note: each undeclared identifier is reported only once for each function it appears in

vim +/max_cur +413 drivers/leds/leds-lm3692x.c

   324	
   325	static enum led_brightness lm3692x_max_brightness(struct lm3692x_led *led,
   326							  u32 max_cur)
   327	{
   328		u32 max_code;
   329	
   330		/* see p.12 of LM36922 data sheet for brightness formula */
 > 331		if (led->brightness_ctrl & LM3692X_MAP_MODE_EXP) {
   332			/*  228 =~ 1.0 / log2(1.003040572) */
   333			max_code = ilog2(max_cur/50) * 228;
   334		} else {
   335			max_code = ((max_cur * 1000) - 37806) / 12195;
   336		}
   337		if (max_code > 0x7FF)
   338			max_code = 0x7FF;
   339	
   340		return max_code >> 3;
   341	}
   342	
   343	static int lm3692x_probe_dt(struct lm3692x_led *led)
   344	{
   345		struct fwnode_handle *child = NULL;
   346		struct led_init_data init_data = {};
   347		u32 ovp;
   348		int ret;
   349	
   350		led->enable_gpio = devm_gpiod_get_optional(&led->client->dev,
   351							   "enable", GPIOD_OUT_LOW);
   352		if (IS_ERR(led->enable_gpio)) {
   353			ret = PTR_ERR(led->enable_gpio);
   354			dev_err(&led->client->dev, "Failed to get enable gpio: %d\n",
   355				ret);
   356			return ret;
   357		}
   358	
   359		led->regulator = devm_regulator_get_optional(&led->client->dev, "vled");
   360		if (IS_ERR(led->regulator)) {
   361			ret = PTR_ERR(led->regulator);
   362			if (ret != -ENODEV) {
   363				if (ret != -EPROBE_DEFER)
   364					dev_err(&led->client->dev,
   365						"Failed to get vled regulator: %d\n",
   366						ret);
   367				return ret;
   368			}
   369			led->regulator = NULL;
   370		}
   371	
   372		led->boost_ctrl = LM3692X_BOOST_SW_1MHZ |
   373			LM3692X_BOOST_SW_NO_SHIFT |
   374			LM3692X_OCP_PROT_1_5A;
   375		ret = device_property_read_u32(&led->client->dev,
   376					       "ti,ovp-microvolt", &ovp);
   377		if (ret) {
   378			led->boost_ctrl |= LM3692X_OVP_29V;
   379		} else {
   380			switch (ovp) {
   381			case 17000000:
   382				break;
   383			case 21000000:
   384				led->boost_ctrl |= LM3692X_OVP_21V;
   385				break;
   386			case 25000000:
   387				led->boost_ctrl |= LM3692X_OVP_25V;
   388				break;
   389			case 29000000:
   390				led->boost_ctrl |= LM3692X_OVP_29V;
   391				break;
   392			default:
   393				dev_err(&led->client->dev, "Invalid OVP %d\n", ovp);
   394				return -EINVAL;
   395			}
   396		}
   397	
   398		child = device_get_next_child_node(&led->client->dev, child);
   399		if (!child) {
   400			dev_err(&led->client->dev, "No LED Child node\n");
   401			return -ENODEV;
   402		}
   403	
   404		fwnode_property_read_string(child, "linux,default-trigger",
   405					    &led->led_dev.default_trigger);
   406	
   407		ret = fwnode_property_read_u32(child, "reg", &led->led_enable);
   408		if (ret) {
   409			dev_err(&led->client->dev, "reg DT property missing\n");
   410			return ret;
   411		}
   412	
 > 413		ret = fwnode_property_read_u32(child, "led-max-microamp", &max_cur);
   414		led->led_dev.max_brightness = ret ? LED_FULL :
   415			lm3692x_max_brightness(led, max_cur);
   416	
   417		init_data.fwnode = child;
   418		init_data.devicename = led->client->name;
   419		init_data.default_label = ":";
   420	
   421		ret = devm_led_classdev_register_ext(&led->client->dev, &led->led_dev,
   422						     &init_data);
   423		if (ret) {
   424			dev_err(&led->client->dev, "led register err: %d\n", ret);
   425			return ret;
   426		}
   427	
   428		return 0;
   429	}
   430	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33362 bytes --]

                 reply	other threads:[~2020-01-06  5:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202001061327.thYBnJ8B%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=agx@sigxcpu.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).