Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
* [pavel-linux-leds:for-next 19/21] drivers/leds/leds-lm3692x.c:413:61: error: 'max_cur' undeclared
@ 2020-01-06  5:28 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-01-06  5:28 UTC (permalink / raw)
  To: Guido Günther; +Cc: kbuild-all, linux-leds, Pavel

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06  5:28 [pavel-linux-leds:for-next 19/21] drivers/leds/leds-lm3692x.c:413:61: error: 'max_cur' undeclared kbuild test robot

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org
	public-inbox-index linux-leds

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git