[gpio:gpio-descriptors-regulator 4/8] drivers//regulator/gpio-regulator.c:161:8: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-regulator
head:   3413d5a29dcb45755d49ae228a802630afd51073
commit: 0c61f72a18f31f45ccc589b8af6e892271f3a7f0 [4/8] regulator: fixed/gpio: Pull inversion/OD into gpiolib
config: i386-randconfig-a1-07092045 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        git checkout 0c61f72a18f31f45ccc589b8af6e892271f3a7f0
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: the gpio/gpio-descriptors-regulator HEAD 3413d5a29dcb45755d49ae228a802630afd51073 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers//regulator/gpio-regulator.c: In function 'of_get_gpio_regulator_config':
>> drivers//regulator/gpio-regulator.c:161:8: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
     config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);
           ^
   In file included from include/linux/err.h:5:0,
                    from drivers//regulator/gpio-regulator.c:25:
   drivers//regulator/gpio-regulator.c:162:12: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
               ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
   drivers//regulator/gpio-regulator.c:162:2: note: in expansion of macro 'if'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
     ^
   drivers//regulator/gpio-regulator.c:162:39: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
                                          ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
   drivers//regulator/gpio-regulator.c:162:2: note: in expansion of macro 'if'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
     ^
   drivers//regulator/gpio-regulator.c:162:12: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
               ^
   include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^
   drivers//regulator/gpio-regulator.c:162:2: note: in expansion of macro 'if'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
     ^
   drivers//regulator/gpio-regulator.c:162:39: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
                                          ^
   include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^
   drivers//regulator/gpio-regulator.c:162:2: note: in expansion of macro 'if'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
     ^
   drivers//regulator/gpio-regulator.c:162:12: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
               ^
   include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
   drivers//regulator/gpio-regulator.c:162:2: note: in expansion of macro 'if'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
     ^
   drivers//regulator/gpio-regulator.c:162:39: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
                                          ^
   include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
   drivers//regulator/gpio-regulator.c:162:2: note: in expansion of macro 'if'
     if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
     ^
   drivers//regulator/gpio-regulator.c:163:24: error: 'struct gpio_regulator_config' has no member named 'enable_gpio'
      return ERR_PTR(config->enable_gpio);
                           ^
   drivers//regulator/gpio-regulator.c: In function 'gpio_regulator_probe':
>> drivers//regulator/gpio-regulator.c:345:3: error: 'gflags' undeclared (first use in this function)
      gflags = GPIOD_OUT_HIGH;
      ^
   drivers//regulator/gpio-regulator.c:345:3: note: each undeclared identifier is reported only once for each function it appears in

vim +161 drivers//regulator/gpio-regulator.c

3f0292ae8b Heiko Stübner            2011-10-05  134  
a451405fcd Axel Lin                 2013-01-28  135  static struct gpio_regulator_config *
072e78b12b Javier Martinez Canillas 2014-11-10  136  of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
072e78b12b Javier Martinez Canillas 2014-11-10  137  			     const struct regulator_desc *desc)
006694d099 Lee Jones                2012-10-15  138  {
006694d099 Lee Jones                2012-10-15  139  	struct gpio_regulator_config *config;
006694d099 Lee Jones                2012-10-15  140  	const char *regtype;
006694d099 Lee Jones                2012-10-15  141  	int proplen, gpio, i;
251b9c21d2 Laurent Pinchart         2013-11-09  142  	int ret;
006694d099 Lee Jones                2012-10-15  143  
006694d099 Lee Jones                2012-10-15  144  	config = devm_kzalloc(dev,
006694d099 Lee Jones                2012-10-15  145  			sizeof(struct gpio_regulator_config),
006694d099 Lee Jones                2012-10-15  146  			GFP_KERNEL);
006694d099 Lee Jones                2012-10-15  147  	if (!config)
006694d099 Lee Jones                2012-10-15  148  		return ERR_PTR(-ENOMEM);
006694d099 Lee Jones                2012-10-15  149  
072e78b12b Javier Martinez Canillas 2014-11-10  150  	config->init_data = of_get_regulator_init_data(dev, np, desc);
006694d099 Lee Jones                2012-10-15  151  	if (!config->init_data)
006694d099 Lee Jones                2012-10-15  152  		return ERR_PTR(-EINVAL);
006694d099 Lee Jones                2012-10-15  153  
006694d099 Lee Jones                2012-10-15  154  	config->supply_name = config->init_data->constraints.name;
006694d099 Lee Jones                2012-10-15  155  
006694d099 Lee Jones                2012-10-15  156  	if (of_property_read_bool(np, "enable-at-boot"))
006694d099 Lee Jones                2012-10-15  157  		config->enabled_at_boot = true;
006694d099 Lee Jones                2012-10-15  158  
006694d099 Lee Jones                2012-10-15  159  	of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
006694d099 Lee Jones                2012-10-15  160  
006694d099 Lee Jones                2012-10-15 @161  	config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);
09f2ba0b0b Jisheng Zhang            2016-11-10 @162  	if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT)
09f2ba0b0b Jisheng Zhang            2016-11-10  163  		return ERR_PTR(config->enable_gpio);
006694d099 Lee Jones                2012-10-15  164  
9f946099fe Richard Fitzgerald       2014-11-19  165  	/* Fetch GPIOs. - optional property*/
9f946099fe Richard Fitzgerald       2014-11-19  166  	ret = of_gpio_count(np);
9f946099fe Richard Fitzgerald       2014-11-19  167  	if ((ret < 0) && (ret != -ENOENT))
9f946099fe Richard Fitzgerald       2014-11-19  168  		return ERR_PTR(ret);
006694d099 Lee Jones                2012-10-15  169  
9f946099fe Richard Fitzgerald       2014-11-19  170  	if (ret > 0) {
9f946099fe Richard Fitzgerald       2014-11-19  171  		config->nr_gpios = ret;
a86854d0c5 Kees Cook                2018-06-12  172  		config->gpios = devm_kcalloc(dev,
a86854d0c5 Kees Cook                2018-06-12  173  					config->nr_gpios, sizeof(struct gpio),
006694d099 Lee Jones                2012-10-15  174  					GFP_KERNEL);
006694d099 Lee Jones                2012-10-15  175  		if (!config->gpios)
006694d099 Lee Jones                2012-10-15  176  			return ERR_PTR(-ENOMEM);
006694d099 Lee Jones                2012-10-15  177  
1f5a9623eb Heiko Stuebner           2014-02-13  178  		proplen = of_property_count_u32_elems(np, "gpios-states");
1f5a9623eb Heiko Stuebner           2014-02-13  179  		/* optional property */
1f5a9623eb Heiko Stuebner           2014-02-13  180  		if (proplen < 0)
1f5a9623eb Heiko Stuebner           2014-02-13  181  			proplen = 0;
1f5a9623eb Heiko Stuebner           2014-02-13  182  
1f5a9623eb Heiko Stuebner           2014-02-13  183  		if (proplen > 0 && proplen != config->nr_gpios) {
5676ddc5c6 Kuninori Morimoto        2014-02-11  184  			dev_warn(dev, "gpios <-> gpios-states mismatch\n");
1f5a9623eb Heiko Stuebner           2014-02-13  185  			proplen = 0;
0094050d78 Kuninori Morimoto        2014-01-30  186  		}
0094050d78 Kuninori Morimoto        2014-01-30  187  
ad0b8b9e82 Lee Jones                2012-12-10  188  		for (i = 0; i < config->nr_gpios; i++) {
006694d099 Lee Jones                2012-10-15  189  			gpio = of_get_named_gpio(np, "gpios", i);
09f2ba0b0b Jisheng Zhang            2016-11-10  190  			if (gpio < 0) {
09f2ba0b0b Jisheng Zhang            2016-11-10  191  				if (gpio != -ENOENT)
09f2ba0b0b Jisheng Zhang            2016-11-10  192  					return ERR_PTR(gpio);
006694d099 Lee Jones                2012-10-15  193  				break;
09f2ba0b0b Jisheng Zhang            2016-11-10  194  			}
006694d099 Lee Jones                2012-10-15  195  			config->gpios[i].gpio = gpio;
37ad490bab Nicholas Lowell          2018-03-19  196  			config->gpios[i].label = config->supply_name;
1f5a9623eb Heiko Stuebner           2014-02-13  197  			if (proplen > 0) {
9f946099fe Richard Fitzgerald       2014-11-19  198  				of_property_read_u32_index(np, "gpios-states",
9f946099fe Richard Fitzgerald       2014-11-19  199  							   i, &ret);
1f5a9623eb Heiko Stuebner           2014-02-13  200  				if (ret)
9f946099fe Richard Fitzgerald       2014-11-19  201  					config->gpios[i].flags =
9f946099fe Richard Fitzgerald       2014-11-19  202  							   GPIOF_OUT_INIT_HIGH;
9f946099fe Richard Fitzgerald       2014-11-19  203  			}
006694d099 Lee Jones                2012-10-15  204  		}
1f5a9623eb Heiko Stuebner           2014-02-13  205  	}
006694d099 Lee Jones                2012-10-15  206  
006694d099 Lee Jones                2012-10-15  207  	/* Fetch states. */
934624d6e9 Heiko Stuebner           2014-02-12  208  	proplen = of_property_count_u32_elems(np, "states");
934624d6e9 Heiko Stuebner           2014-02-12  209  	if (proplen < 0) {
216f2b9c95 Lee Jones                2012-11-14  210  		dev_err(dev, "No 'states' property found\n");
216f2b9c95 Lee Jones                2012-11-14  211  		return ERR_PTR(-EINVAL);
216f2b9c95 Lee Jones                2012-11-14  212  	}
216f2b9c95 Lee Jones                2012-11-14  213  
a86854d0c5 Kees Cook                2018-06-12  214  	config->states = devm_kcalloc(dev,
a86854d0c5 Kees Cook                2018-06-12  215  				proplen / 2,
a86854d0c5 Kees Cook                2018-06-12  216  				sizeof(struct gpio_regulator_state),
006694d099 Lee Jones                2012-10-15  217  				GFP_KERNEL);
006694d099 Lee Jones                2012-10-15  218  	if (!config->states)
006694d099 Lee Jones                2012-10-15  219  		return ERR_PTR(-ENOMEM);
006694d099 Lee Jones                2012-10-15  220  
006694d099 Lee Jones                2012-10-15  221  	for (i = 0; i < proplen / 2; i++) {
934624d6e9 Heiko Stuebner           2014-02-12  222  		of_property_read_u32_index(np, "states", i * 2,
934624d6e9 Heiko Stuebner           2014-02-12  223  					   &config->states[i].value);
934624d6e9 Heiko Stuebner           2014-02-12  224  		of_property_read_u32_index(np, "states", i * 2 + 1,
934624d6e9 Heiko Stuebner           2014-02-12  225  					   &config->states[i].gpios);
006694d099 Lee Jones                2012-10-15  226  	}
006694d099 Lee Jones                2012-10-15  227  	config->nr_states = i;
006694d099 Lee Jones                2012-10-15  228  
5b1ada83ba Mark Brown               2013-12-05  229  	config->type = REGULATOR_VOLTAGE;
251b9c21d2 Laurent Pinchart         2013-11-09  230  	ret = of_property_read_string(np, "regulator-type", &regtype);
5b1ada83ba Mark Brown               2013-12-05  231  	if (ret >= 0) {
006694d099 Lee Jones                2012-10-15  232  		if (!strncmp("voltage", regtype, 7))
006694d099 Lee Jones                2012-10-15  233  			config->type = REGULATOR_VOLTAGE;
006694d099 Lee Jones                2012-10-15  234  		else if (!strncmp("current", regtype, 7))
006694d099 Lee Jones                2012-10-15  235  			config->type = REGULATOR_CURRENT;
9eb9d3150b Mark Brown               2013-12-05  236  		else
9eb9d3150b Mark Brown               2013-12-05  237  			dev_warn(dev, "Unknown regulator-type '%s'\n",
9eb9d3150b Mark Brown               2013-12-05  238  				 regtype);
5b1ada83ba Mark Brown               2013-12-05  239  	}
006694d099 Lee Jones                2012-10-15  240  
006694d099 Lee Jones                2012-10-15  241  	return config;
006694d099 Lee Jones                2012-10-15  242  }
006694d099 Lee Jones                2012-10-15  243  
3f0292ae8b Heiko Stübner            2011-10-05  244  static struct regulator_ops gpio_regulator_current_ops = {
3f0292ae8b Heiko Stübner            2011-10-05  245  	.get_current_limit = gpio_regulator_get_value,
3f0292ae8b Heiko Stübner            2011-10-05  246  	.set_current_limit = gpio_regulator_set_current_limit,
3f0292ae8b Heiko Stübner            2011-10-05  247  };
3f0292ae8b Heiko Stübner            2011-10-05  248  
a5023574d1 Bill Pemberton           2012-11-19  249  static int gpio_regulator_probe(struct platform_device *pdev)
3f0292ae8b Heiko Stübner            2011-10-05  250  {
dff91d0b72 Jingoo Han               2013-07-30  251  	struct gpio_regulator_config *config = dev_get_platdata(&pdev->dev);
006694d099 Lee Jones                2012-10-15  252  	struct device_node *np = pdev->dev.of_node;
3f0292ae8b Heiko Stübner            2011-10-05  253  	struct gpio_regulator_data *drvdata;
c172708d38 Mark Brown               2012-04-04  254  	struct regulator_config cfg = { };
3f0292ae8b Heiko Stübner            2011-10-05  255  	int ptr, ret, state;
3f0292ae8b Heiko Stübner            2011-10-05  256  
02b552160f Mark Brown               2012-04-03  257  	drvdata = devm_kzalloc(&pdev->dev, sizeof(struct gpio_regulator_data),
02b552160f Mark Brown               2012-04-03  258  			       GFP_KERNEL);
9c25960cbb Fabio Estevam            2014-01-24  259  	if (drvdata == NULL)
3f0292ae8b Heiko Stübner            2011-10-05  260  		return -ENOMEM;
3f0292ae8b Heiko Stübner            2011-10-05  261  
072e78b12b Javier Martinez Canillas 2014-11-10  262  	if (np) {
072e78b12b Javier Martinez Canillas 2014-11-10  263  		config = of_get_gpio_regulator_config(&pdev->dev, np,
072e78b12b Javier Martinez Canillas 2014-11-10  264  						      &drvdata->desc);
072e78b12b Javier Martinez Canillas 2014-11-10  265  		if (IS_ERR(config))
072e78b12b Javier Martinez Canillas 2014-11-10  266  			return PTR_ERR(config);
072e78b12b Javier Martinez Canillas 2014-11-10  267  	}
072e78b12b Javier Martinez Canillas 2014-11-10  268  
3f0292ae8b Heiko Stübner            2011-10-05  269  	drvdata->desc.name = kstrdup(config->supply_name, GFP_KERNEL);
3f0292ae8b Heiko Stübner            2011-10-05  270  	if (drvdata->desc.name == NULL) {
3f0292ae8b Heiko Stübner            2011-10-05  271  		dev_err(&pdev->dev, "Failed to allocate supply name\n");
ed8cffda27 Christophe Jaillet       2018-03-13  272  		return -ENOMEM;
3f0292ae8b Heiko Stübner            2011-10-05  273  	}
3f0292ae8b Heiko Stübner            2011-10-05  274  
9f946099fe Richard Fitzgerald       2014-11-19  275  	if (config->nr_gpios != 0) {
3f0292ae8b Heiko Stübner            2011-10-05  276  		drvdata->gpios = kmemdup(config->gpios,
3f0292ae8b Heiko Stübner            2011-10-05  277  					 config->nr_gpios * sizeof(struct gpio),
3f0292ae8b Heiko Stübner            2011-10-05  278  					 GFP_KERNEL);
3f0292ae8b Heiko Stübner            2011-10-05  279  		if (drvdata->gpios == NULL) {
3f0292ae8b Heiko Stübner            2011-10-05  280  			dev_err(&pdev->dev, "Failed to allocate gpio data\n");
3f0292ae8b Heiko Stübner            2011-10-05  281  			ret = -ENOMEM;
3f0292ae8b Heiko Stübner            2011-10-05  282  			goto err_name;
3f0292ae8b Heiko Stübner            2011-10-05  283  		}
3f0292ae8b Heiko Stübner            2011-10-05  284  
9f946099fe Richard Fitzgerald       2014-11-19  285  		drvdata->nr_gpios = config->nr_gpios;
9f946099fe Richard Fitzgerald       2014-11-19  286  		ret = gpio_request_array(drvdata->gpios, drvdata->nr_gpios);
9f946099fe Richard Fitzgerald       2014-11-19  287  		if (ret) {
0258382bf3 Rabin Vincent            2016-02-19  288  			if (ret != -EPROBE_DEFER)
9f946099fe Richard Fitzgerald       2014-11-19  289  				dev_err(&pdev->dev,
0258382bf3 Rabin Vincent            2016-02-19  290  					"Could not obtain regulator setting GPIOs: %d\n",
0258382bf3 Rabin Vincent            2016-02-19  291  					ret);
ed8cffda27 Christophe Jaillet       2018-03-13  292  			goto err_memgpio;
9f946099fe Richard Fitzgerald       2014-11-19  293  		}
9f946099fe Richard Fitzgerald       2014-11-19  294  	}
9f946099fe Richard Fitzgerald       2014-11-19  295  
3f0292ae8b Heiko Stübner            2011-10-05  296  	drvdata->states = kmemdup(config->states,
3f0292ae8b Heiko Stübner            2011-10-05  297  				  config->nr_states *
3f0292ae8b Heiko Stübner            2011-10-05  298  					 sizeof(struct gpio_regulator_state),
3f0292ae8b Heiko Stübner            2011-10-05  299  				  GFP_KERNEL);
3f0292ae8b Heiko Stübner            2011-10-05  300  	if (drvdata->states == NULL) {
3f0292ae8b Heiko Stübner            2011-10-05  301  		dev_err(&pdev->dev, "Failed to allocate state data\n");
3f0292ae8b Heiko Stübner            2011-10-05  302  		ret = -ENOMEM;
ed8cffda27 Christophe Jaillet       2018-03-13  303  		goto err_stategpio;
3f0292ae8b Heiko Stübner            2011-10-05  304  	}
3f0292ae8b Heiko Stübner            2011-10-05  305  	drvdata->nr_states = config->nr_states;
3f0292ae8b Heiko Stübner            2011-10-05  306  
3f0292ae8b Heiko Stübner            2011-10-05  307  	drvdata->desc.owner = THIS_MODULE;
a2a8222be8 Axel Lin                 2012-07-04  308  	drvdata->desc.enable_time = config->startup_delay;
3f0292ae8b Heiko Stübner            2011-10-05  309  
3f0292ae8b Heiko Stübner            2011-10-05  310  	/* handle regulator type*/
3f0292ae8b Heiko Stübner            2011-10-05  311  	switch (config->type) {
3f0292ae8b Heiko Stübner            2011-10-05  312  	case REGULATOR_VOLTAGE:
3f0292ae8b Heiko Stübner            2011-10-05  313  		drvdata->desc.type = REGULATOR_VOLTAGE;
3f0292ae8b Heiko Stübner            2011-10-05  314  		drvdata->desc.ops = &gpio_regulator_voltage_ops;
3f0292ae8b Heiko Stübner            2011-10-05  315  		drvdata->desc.n_voltages = config->nr_states;
3f0292ae8b Heiko Stübner            2011-10-05  316  		break;
3f0292ae8b Heiko Stübner            2011-10-05  317  	case REGULATOR_CURRENT:
3f0292ae8b Heiko Stübner            2011-10-05  318  		drvdata->desc.type = REGULATOR_CURRENT;
3f0292ae8b Heiko Stübner            2011-10-05  319  		drvdata->desc.ops = &gpio_regulator_current_ops;
3f0292ae8b Heiko Stübner            2011-10-05  320  		break;
3f0292ae8b Heiko Stübner            2011-10-05  321  	default:
3f0292ae8b Heiko Stübner            2011-10-05  322  		dev_err(&pdev->dev, "No regulator type set\n");
3f0292ae8b Heiko Stübner            2011-10-05  323  		ret = -EINVAL;
ed8cffda27 Christophe Jaillet       2018-03-13  324  		goto err_memstate;
3f0292ae8b Heiko Stübner            2011-10-05  325  	}
3f0292ae8b Heiko Stübner            2011-10-05  326  
3f0292ae8b Heiko Stübner            2011-10-05  327  	/* build initial state from gpio init data. */
3f0292ae8b Heiko Stübner            2011-10-05  328  	state = 0;
3f0292ae8b Heiko Stübner            2011-10-05  329  	for (ptr = 0; ptr < drvdata->nr_gpios; ptr++) {
3f0292ae8b Heiko Stübner            2011-10-05  330  		if (config->gpios[ptr].flags & GPIOF_OUT_INIT_HIGH)
3f0292ae8b Heiko Stübner            2011-10-05  331  			state |= (1 << ptr);
3f0292ae8b Heiko Stübner            2011-10-05  332  	}
3f0292ae8b Heiko Stübner            2011-10-05  333  	drvdata->state = state;
3f0292ae8b Heiko Stübner            2011-10-05  334  
c172708d38 Mark Brown               2012-04-04  335  	cfg.dev = &pdev->dev;
c172708d38 Mark Brown               2012-04-04  336  	cfg.init_data = config->init_data;
7d4be2f5ad Heiko Stübner            2012-06-03  337  	cfg.driver_data = drvdata;
f8a9f757cb Frank Li                 2012-11-12  338  	cfg.of_node = np;
c172708d38 Mark Brown               2012-04-04  339  
0c61f72a18 Linus Walleij            2017-12-31  340  	/*
0c61f72a18 Linus Walleij            2017-12-31  341  	 * The signal will be inverted by the GPIO core if flagged so in the
0c61f72a18 Linus Walleij            2017-12-31  342  	 * decriptor.
0c61f72a18 Linus Walleij            2017-12-31  343  	 */
0c61f72a18 Linus Walleij            2017-12-31  344  	if (config->enabled_at_boot)
0c61f72a18 Linus Walleij            2017-12-31 @345  		gflags = GPIOD_OUT_HIGH;
4b7c948f55 Axel Lin                 2012-07-04  346  	else
0c61f72a18 Linus Walleij            2017-12-31  347  		gflags = GPIOD_OUT_LOW;
0c61f72a18 Linus Walleij            2017-12-31  348  
0c61f72a18 Linus Walleij            2017-12-31  349  	cfg.ena_gpiod = devm_gpiod_get_optional(&pdev->dev, "enable", gflags);
0c61f72a18 Linus Walleij            2017-12-31  350  	if (IS_ERR(cfg.ena_gpiod)) {
0c61f72a18 Linus Walleij            2017-12-31  351  		ret = PTR_ERR(cfg.ena_gpiod);
0c61f72a18 Linus Walleij            2017-12-31  352  		goto err_stategpio;
4b7c948f55 Axel Lin                 2012-07-04  353  	}
4b7c948f55 Axel Lin                 2012-07-04  354  
c172708d38 Mark Brown               2012-04-04  355  	drvdata->dev = regulator_register(&drvdata->desc, &cfg);
3f0292ae8b Heiko Stübner            2011-10-05  356  	if (IS_ERR(drvdata->dev)) {
3f0292ae8b Heiko Stübner            2011-10-05  357  		ret = PTR_ERR(drvdata->dev);
3f0292ae8b Heiko Stübner            2011-10-05  358  		dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);
ed8cffda27 Christophe Jaillet       2018-03-13  359  		goto err_memstate;
3f0292ae8b Heiko Stübner            2011-10-05  360  	}
3f0292ae8b Heiko Stübner            2011-10-05  361  
3f0292ae8b Heiko Stübner            2011-10-05  362  	platform_set_drvdata(pdev, drvdata);
3f0292ae8b Heiko Stübner            2011-10-05  363  
3f0292ae8b Heiko Stübner            2011-10-05  364  	return 0;
3f0292ae8b Heiko Stübner            2011-10-05  365  
3f0292ae8b Heiko Stübner            2011-10-05  366  err_memstate:
3f0292ae8b Heiko Stübner            2011-10-05  367  	kfree(drvdata->states);
ed8cffda27 Christophe Jaillet       2018-03-13  368  err_stategpio:
ed8cffda27 Christophe Jaillet       2018-03-13  369  	gpio_free_array(drvdata->gpios, drvdata->nr_gpios);
3f0292ae8b Heiko Stübner            2011-10-05  370  err_memgpio:
3f0292ae8b Heiko Stübner            2011-10-05  371  	kfree(drvdata->gpios);
3f0292ae8b Heiko Stübner            2011-10-05  372  err_name:
3f0292ae8b Heiko Stübner            2011-10-05  373  	kfree(drvdata->desc.name);
3f0292ae8b Heiko Stübner            2011-10-05  374  	return ret;
3f0292ae8b Heiko Stübner            2011-10-05  375  }
3f0292ae8b Heiko Stübner            2011-10-05  376  

:::::: The code at line 161 was first introduced by commit
:::::: 006694d099e86e5a928fb39bdea280ab42c9d59c regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT

:::::: TO: Lee Jones <lee.jones@xxxxxxxxxx>
:::::: CC: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux