Linux-GPIO Archive on lore.kernel.org
 help / color / Atom feed
* [gpio:gpio-descriptors-backlight 1/1] drivers/video/backlight/pwm_bl.c:260:6: error: 'struct platform_pwm_backlight_data' has no member named 'enable_gpio'
@ 2019-12-02 21:27 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-12-02 21:27 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kbuild-all, linux-gpio

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-backlight
head:   67766de50b11fce3495298690d1c27078c51cd03
commit: 67766de50b11fce3495298690d1c27078c51cd03 [1/1] backlight: pwm_bl: Switch to full GPIO descriptor
config: i386-randconfig-d002-20191202 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-1) 7.5.0
reproduce:
        git checkout 67766de50b11fce3495298690d1c27078c51cd03
        # 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/video/backlight/pwm_bl.c: In function 'pwm_backlight_parse_dt':
>> drivers/video/backlight/pwm_bl.c:260:6: error: 'struct platform_pwm_backlight_data' has no member named 'enable_gpio'
     data->enable_gpio = -EINVAL;
         ^~

vim +260 drivers/video/backlight/pwm_bl.c

88ba95bedb7958 Enric Balletbo i Serra 2018-04-09  233  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  234  static int pwm_backlight_parse_dt(struct device *dev,
3e3ed6cdc49d75 Thierry Reding         2011-12-16  235  				  struct platform_pwm_backlight_data *data)
3e3ed6cdc49d75 Thierry Reding         2011-12-16  236  {
3e3ed6cdc49d75 Thierry Reding         2011-12-16  237  	struct device_node *node = dev->of_node;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  238  	unsigned int num_levels = 0;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  239  	unsigned int levels_count;
633786736ed53a Daniel Thompson        2018-07-25  240  	unsigned int num_steps = 0;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  241  	struct property *prop;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  242  	unsigned int *table;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  243  	int length;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  244  	u32 value;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  245  	int ret;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  246  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  247  	if (!node)
3e3ed6cdc49d75 Thierry Reding         2011-12-16  248  		return -ENODEV;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  249  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  250  	memset(data, 0, sizeof(*data));
3e3ed6cdc49d75 Thierry Reding         2011-12-16  251  
61170ee9386888 Heiko Stuebner         2018-11-12  252  	/*
61170ee9386888 Heiko Stuebner         2018-11-12  253  	 * These values are optional and set as 0 by default, the out values
61170ee9386888 Heiko Stuebner         2018-11-12  254  	 * are modified only if a valid u32 value can be decoded.
61170ee9386888 Heiko Stuebner         2018-11-12  255  	 */
61170ee9386888 Heiko Stuebner         2018-11-12  256  	of_property_read_u32(node, "post-pwm-on-delay-ms",
61170ee9386888 Heiko Stuebner         2018-11-12  257  			     &data->post_pwm_on_delay);
61170ee9386888 Heiko Stuebner         2018-11-12  258  	of_property_read_u32(node, "pwm-off-delay-ms", &data->pwm_off_delay);
61170ee9386888 Heiko Stuebner         2018-11-12  259  
61170ee9386888 Heiko Stuebner         2018-11-12 @260  	data->enable_gpio = -EINVAL;
61170ee9386888 Heiko Stuebner         2018-11-12  261  
88ba95bedb7958 Enric Balletbo i Serra 2018-04-09  262  	/*
88ba95bedb7958 Enric Balletbo i Serra 2018-04-09  263  	 * Determine the number of brightness levels, if this property is not
88ba95bedb7958 Enric Balletbo i Serra 2018-04-09  264  	 * set a default table of brightness levels will be used.
88ba95bedb7958 Enric Balletbo i Serra 2018-04-09  265  	 */
3e3ed6cdc49d75 Thierry Reding         2011-12-16  266  	prop = of_find_property(node, "brightness-levels", &length);
3e3ed6cdc49d75 Thierry Reding         2011-12-16  267  	if (!prop)
88ba95bedb7958 Enric Balletbo i Serra 2018-04-09  268  		return 0;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  269  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  270  	data->max_brightness = length / sizeof(u32);
3e3ed6cdc49d75 Thierry Reding         2011-12-16  271  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  272  	/* read brightness levels from DT property */
3e3ed6cdc49d75 Thierry Reding         2011-12-16  273  	if (data->max_brightness > 0) {
3e3ed6cdc49d75 Thierry Reding         2011-12-16  274  		size_t size = sizeof(*data->levels) * data->max_brightness;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  275  		unsigned int i, j, n = 0;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  276  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  277  		data->levels = devm_kzalloc(dev, size, GFP_KERNEL);
3e3ed6cdc49d75 Thierry Reding         2011-12-16  278  		if (!data->levels)
3e3ed6cdc49d75 Thierry Reding         2011-12-16  279  			return -ENOMEM;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  280  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  281  		ret = of_property_read_u32_array(node, "brightness-levels",
3e3ed6cdc49d75 Thierry Reding         2011-12-16  282  						 data->levels,
3e3ed6cdc49d75 Thierry Reding         2011-12-16  283  						 data->max_brightness);
3e3ed6cdc49d75 Thierry Reding         2011-12-16  284  		if (ret < 0)
3e3ed6cdc49d75 Thierry Reding         2011-12-16  285  			return ret;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  286  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  287  		ret = of_property_read_u32(node, "default-brightness-level",
3e3ed6cdc49d75 Thierry Reding         2011-12-16  288  					   &value);
3e3ed6cdc49d75 Thierry Reding         2011-12-16  289  		if (ret < 0)
3e3ed6cdc49d75 Thierry Reding         2011-12-16  290  			return ret;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  291  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  292  		data->dft_brightness = value;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  293  
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  294  		/*
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  295  		 * This property is optional, if is set enables linear
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  296  		 * interpolation between each of the values of brightness levels
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  297  		 * and creates a new pre-computed table.
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  298  		 */
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  299  		of_property_read_u32(node, "num-interpolated-steps",
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  300  				     &num_steps);
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  301  
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  302  		/*
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  303  		 * Make sure that there is at least two entries in the
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  304  		 * brightness-levels table, otherwise we can't interpolate
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  305  		 * between two points.
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  306  		 */
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  307  		if (num_steps) {
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  308  			if (data->max_brightness < 2) {
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  309  				dev_err(dev, "can't interpolate\n");
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  310  				return -EINVAL;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  311  			}
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  312  
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  313  			/*
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  314  			 * Recalculate the number of brightness levels, now
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  315  			 * taking in consideration the number of interpolated
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  316  			 * steps between two levels.
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  317  			 */
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  318  			for (i = 0; i < data->max_brightness - 1; i++) {
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  319  				if ((data->levels[i + 1] - data->levels[i]) /
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  320  				   num_steps)
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  321  					num_levels += num_steps;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  322  				else
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  323  					num_levels++;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  324  			}
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  325  			num_levels++;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  326  			dev_dbg(dev, "new number of brightness levels: %d\n",
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  327  				num_levels);
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  328  
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  329  			/*
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  330  			 * Create a new table of brightness levels with all the
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  331  			 * interpolated steps.
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  332  			 */
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  333  			size = sizeof(*table) * num_levels;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  334  			table = devm_kzalloc(dev, size, GFP_KERNEL);
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  335  			if (!table)
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  336  				return -ENOMEM;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  337  
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  338  			/* Fill the interpolated table. */
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  339  			levels_count = 0;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  340  			for (i = 0; i < data->max_brightness - 1; i++) {
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  341  				value = data->levels[i];
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  342  				n = (data->levels[i + 1] - value) / num_steps;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  343  				if (n > 0) {
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  344  					for (j = 0; j < num_steps; j++) {
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  345  						table[levels_count] = value;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  346  						value += n;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  347  						levels_count++;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  348  					}
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  349  				} else {
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  350  					table[levels_count] = data->levels[i];
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  351  					levels_count++;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  352  				}
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  353  			}
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  354  			table[levels_count] = data->levels[i];
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  355  
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  356  			/*
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  357  			 * As we use interpolation lets remove current
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  358  			 * brightness levels table and replace for the
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  359  			 * new interpolated table.
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  360  			 */
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  361  			devm_kfree(dev, data->levels);
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  362  			data->levels = table;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  363  
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  364  			/*
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  365  			 * Reassign max_brightness value to the new total number
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  366  			 * of brightness levels.
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  367  			 */
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  368  			data->max_brightness = num_levels;
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  369  		}
573fe6d1c25c81 Enric Balletbo i Serra 2018-04-09  370  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  371  		data->max_brightness--;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  372  	}
3e3ed6cdc49d75 Thierry Reding         2011-12-16  373  
3e3ed6cdc49d75 Thierry Reding         2011-12-16  374  	return 0;
3e3ed6cdc49d75 Thierry Reding         2011-12-16  375  }
3e3ed6cdc49d75 Thierry Reding         2011-12-16  376  

:::::: The code at line 260 was first introduced by commit
:::::: 61170ee9386888f1e6f7e9cc58e8d9a8c2a3c1dd backlight: pwm_bl: Fix devicetree parsing with auto-generated brightness tables

:::::: TO: Heiko Stuebner <heiko.stuebner@bq.com>
:::::: CC: Lee Jones <lee.jones@linaro.org>

---
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: 34552 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 --
2019-12-02 21:27 [gpio:gpio-descriptors-backlight 1/1] drivers/video/backlight/pwm_bl.c:260:6: error: 'struct platform_pwm_backlight_data' has no member named 'enable_gpio' kbuild test robot

Linux-GPIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-gpio/0 linux-gpio/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-gpio linux-gpio/ https://lore.kernel.org/linux-gpio \
		linux-gpio@vger.kernel.org
	public-inbox-index linux-gpio

Example config snippet for mirrors

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


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