lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 6 Jun 2018 22:04:03 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Marek Vasut <marek.vasut@...il.com>
Cc:     kbuild-all@...org, linux-kernel@...r.kernel.org,
        Marek Vasut <marek.vasut+renesas@...il.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Lee Jones <lee.jones@...aro.org>,
        Mark Brown <broonie@...nel.org>,
        Steve Twiss <stwiss.opensource@...semi.com>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH v4 06/12] mfd: da9063: Replace model with type

Hi Marek,

I love your patch! Yet something to improve:

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v4.17 next-20180605]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Marek-Vasut/mfd-da9063-Fix-failpath-in-core/20180606-212247
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: i386-randconfig-x079-201822 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/regulator/da9063-regulator.c: In function 'da9063_regulator_probe':
>> drivers/regulator/da9063-regulator.c:749:10: error: 'struct da9063' has no member named 'model'
       da9063->model);
             ^~

vim +749 drivers/regulator/da9063-regulator.c

69ca3e58 Krystian Garbaciak 2013-07-29  715  
69ca3e58 Krystian Garbaciak 2013-07-29  716  static int da9063_regulator_probe(struct platform_device *pdev)
69ca3e58 Krystian Garbaciak 2013-07-29  717  {
69ca3e58 Krystian Garbaciak 2013-07-29  718  	struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent);
69ca3e58 Krystian Garbaciak 2013-07-29  719  	struct da9063_pdata *da9063_pdata = dev_get_platdata(da9063->dev);
0fdfd40a Geert Uytterhoeven 2013-09-09  720  	struct of_regulator_match *da9063_reg_matches = NULL;
69ca3e58 Krystian Garbaciak 2013-07-29  721  	struct da9063_regulators_pdata *regl_pdata;
69ca3e58 Krystian Garbaciak 2013-07-29  722  	const struct da9063_dev_model *model;
69ca3e58 Krystian Garbaciak 2013-07-29  723  	struct da9063_regulators *regulators;
69ca3e58 Krystian Garbaciak 2013-07-29  724  	struct da9063_regulator *regl;
69ca3e58 Krystian Garbaciak 2013-07-29  725  	struct regulator_config config;
69ca3e58 Krystian Garbaciak 2013-07-29  726  	bool bcores_merged, bmem_bio_merged;
69ca3e58 Krystian Garbaciak 2013-07-29  727  	int id, irq, n, n_regulators, ret, val;
69ca3e58 Krystian Garbaciak 2013-07-29  728  	size_t size;
69ca3e58 Krystian Garbaciak 2013-07-29  729  
69ca3e58 Krystian Garbaciak 2013-07-29  730  	regl_pdata = da9063_pdata ? da9063_pdata->regulators_pdata : NULL;
69ca3e58 Krystian Garbaciak 2013-07-29  731  
69ca3e58 Krystian Garbaciak 2013-07-29  732  	if (!regl_pdata)
69ca3e58 Krystian Garbaciak 2013-07-29  733  		regl_pdata = da9063_parse_regulators_dt(pdev,
69ca3e58 Krystian Garbaciak 2013-07-29  734  							&da9063_reg_matches);
69ca3e58 Krystian Garbaciak 2013-07-29  735  
69ca3e58 Krystian Garbaciak 2013-07-29  736  	if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) {
69ca3e58 Krystian Garbaciak 2013-07-29  737  		dev_err(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  738  			"No regulators defined for the platform\n");
b6615659 Dan Carpenter      2017-08-30  739  		return -ENODEV;
69ca3e58 Krystian Garbaciak 2013-07-29  740  	}
69ca3e58 Krystian Garbaciak 2013-07-29  741  
69ca3e58 Krystian Garbaciak 2013-07-29  742  	/* Find regulators set for particular device model */
69ca3e58 Krystian Garbaciak 2013-07-29  743  	for (model = regulators_models; model->regulator_info; model++) {
9a58dfc5 Marek Vasut        2018-06-06  744  		if (model->type == da9063->type)
69ca3e58 Krystian Garbaciak 2013-07-29  745  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  746  	}
69ca3e58 Krystian Garbaciak 2013-07-29  747  	if (!model->regulator_info) {
69ca3e58 Krystian Garbaciak 2013-07-29  748  		dev_err(&pdev->dev, "Chip model not recognised (%u)\n",
69ca3e58 Krystian Garbaciak 2013-07-29 @749  			da9063->model);
69ca3e58 Krystian Garbaciak 2013-07-29  750  		return -ENODEV;
69ca3e58 Krystian Garbaciak 2013-07-29  751  	}
69ca3e58 Krystian Garbaciak 2013-07-29  752  
69ca3e58 Krystian Garbaciak 2013-07-29  753  	ret = regmap_read(da9063->regmap, DA9063_REG_CONFIG_H, &val);
69ca3e58 Krystian Garbaciak 2013-07-29  754  	if (ret < 0) {
69ca3e58 Krystian Garbaciak 2013-07-29  755  		dev_err(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  756  			"Error while reading BUCKs configuration\n");
8a7963d5 Sachin Kamat       2014-02-18  757  		return ret;
69ca3e58 Krystian Garbaciak 2013-07-29  758  	}
69ca3e58 Krystian Garbaciak 2013-07-29  759  	bcores_merged = val & DA9063_BCORE_MERGE;
69ca3e58 Krystian Garbaciak 2013-07-29  760  	bmem_bio_merged = val & DA9063_BUCK_MERGE;
69ca3e58 Krystian Garbaciak 2013-07-29  761  
69ca3e58 Krystian Garbaciak 2013-07-29  762  	n_regulators = model->n_regulators;
69ca3e58 Krystian Garbaciak 2013-07-29  763  	if (bcores_merged)
69ca3e58 Krystian Garbaciak 2013-07-29  764  		n_regulators -= 2; /* remove BCORE1, BCORE2 */
69ca3e58 Krystian Garbaciak 2013-07-29  765  	else
69ca3e58 Krystian Garbaciak 2013-07-29  766  		n_regulators--;    /* remove BCORES_MERGED */
69ca3e58 Krystian Garbaciak 2013-07-29  767  	if (bmem_bio_merged)
69ca3e58 Krystian Garbaciak 2013-07-29  768  		n_regulators -= 2; /* remove BMEM, BIO */
69ca3e58 Krystian Garbaciak 2013-07-29  769  	else
69ca3e58 Krystian Garbaciak 2013-07-29  770  		n_regulators--;    /* remove BMEM_BIO_MERGED */
69ca3e58 Krystian Garbaciak 2013-07-29  771  
69ca3e58 Krystian Garbaciak 2013-07-29  772  	/* Allocate memory required by usable regulators */
69ca3e58 Krystian Garbaciak 2013-07-29  773  	size = sizeof(struct da9063_regulators) +
69ca3e58 Krystian Garbaciak 2013-07-29  774  		n_regulators * sizeof(struct da9063_regulator);
69ca3e58 Krystian Garbaciak 2013-07-29  775  	regulators = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
8b5baa56 Sachin Kamat       2014-02-20  776  	if (!regulators)
69ca3e58 Krystian Garbaciak 2013-07-29  777  		return -ENOMEM;
69ca3e58 Krystian Garbaciak 2013-07-29  778  
69ca3e58 Krystian Garbaciak 2013-07-29  779  	regulators->n_regulators = n_regulators;
69ca3e58 Krystian Garbaciak 2013-07-29  780  	platform_set_drvdata(pdev, regulators);
69ca3e58 Krystian Garbaciak 2013-07-29  781  
69ca3e58 Krystian Garbaciak 2013-07-29  782  	/* Register all regulators declared in platform information */
69ca3e58 Krystian Garbaciak 2013-07-29  783  	n = 0;
69ca3e58 Krystian Garbaciak 2013-07-29  784  	id = 0;
69ca3e58 Krystian Garbaciak 2013-07-29  785  	while (n < regulators->n_regulators) {
69ca3e58 Krystian Garbaciak 2013-07-29  786  		/* Skip regulator IDs depending on merge mode configuration */
69ca3e58 Krystian Garbaciak 2013-07-29  787  		switch (id) {
69ca3e58 Krystian Garbaciak 2013-07-29  788  		case DA9063_ID_BCORE1:
69ca3e58 Krystian Garbaciak 2013-07-29  789  		case DA9063_ID_BCORE2:
69ca3e58 Krystian Garbaciak 2013-07-29  790  			if (bcores_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  791  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  792  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  793  			}
69ca3e58 Krystian Garbaciak 2013-07-29  794  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  795  		case DA9063_ID_BMEM:
69ca3e58 Krystian Garbaciak 2013-07-29  796  		case DA9063_ID_BIO:
69ca3e58 Krystian Garbaciak 2013-07-29  797  			if (bmem_bio_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  798  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  799  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  800  			}
69ca3e58 Krystian Garbaciak 2013-07-29  801  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  802  		case DA9063_ID_BCORES_MERGED:
69ca3e58 Krystian Garbaciak 2013-07-29  803  			if (!bcores_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  804  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  805  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  806  			}
69ca3e58 Krystian Garbaciak 2013-07-29  807  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  808  		case DA9063_ID_BMEM_BIO_MERGED:
69ca3e58 Krystian Garbaciak 2013-07-29  809  			if (!bmem_bio_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  810  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  811  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  812  			}
69ca3e58 Krystian Garbaciak 2013-07-29  813  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  814  		}
69ca3e58 Krystian Garbaciak 2013-07-29  815  
69ca3e58 Krystian Garbaciak 2013-07-29  816  		/* Initialise regulator structure */
69ca3e58 Krystian Garbaciak 2013-07-29  817  		regl = &regulators->regulator[n];
69ca3e58 Krystian Garbaciak 2013-07-29  818  		regl->hw = da9063;
69ca3e58 Krystian Garbaciak 2013-07-29  819  		regl->info = &model->regulator_info[id];
69ca3e58 Krystian Garbaciak 2013-07-29  820  		regl->desc = regl->info->desc;
69ca3e58 Krystian Garbaciak 2013-07-29  821  		regl->desc.type = REGULATOR_VOLTAGE;
69ca3e58 Krystian Garbaciak 2013-07-29  822  		regl->desc.owner = THIS_MODULE;
69ca3e58 Krystian Garbaciak 2013-07-29  823  
69ca3e58 Krystian Garbaciak 2013-07-29  824  		if (regl->info->mode.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  825  			regl->mode = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  826  					da9063->regmap, regl->info->mode);
69ca3e58 Krystian Garbaciak 2013-07-29  827  		if (regl->info->suspend.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  828  			regl->suspend = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  829  					da9063->regmap, regl->info->suspend);
69ca3e58 Krystian Garbaciak 2013-07-29  830  		if (regl->info->sleep.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  831  			regl->sleep = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  832  					da9063->regmap, regl->info->sleep);
69ca3e58 Krystian Garbaciak 2013-07-29  833  		if (regl->info->suspend_sleep.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  834  			regl->suspend_sleep = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  835  					da9063->regmap, regl->info->suspend_sleep);
69ca3e58 Krystian Garbaciak 2013-07-29  836  		if (regl->info->ilimit.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  837  			regl->ilimit = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  838  					da9063->regmap, regl->info->ilimit);
69ca3e58 Krystian Garbaciak 2013-07-29  839  
69ca3e58 Krystian Garbaciak 2013-07-29  840  		/* Register regulator */
69ca3e58 Krystian Garbaciak 2013-07-29  841  		memset(&config, 0, sizeof(config));
69ca3e58 Krystian Garbaciak 2013-07-29  842  		config.dev = &pdev->dev;
69ca3e58 Krystian Garbaciak 2013-07-29  843  		config.init_data = da9063_get_regulator_initdata(regl_pdata, id);
69ca3e58 Krystian Garbaciak 2013-07-29  844  		config.driver_data = regl;
69ca3e58 Krystian Garbaciak 2013-07-29  845  		if (da9063_reg_matches)
69ca3e58 Krystian Garbaciak 2013-07-29  846  			config.of_node = da9063_reg_matches[id].of_node;
69ca3e58 Krystian Garbaciak 2013-07-29  847  		config.regmap = da9063->regmap;
e97bba91 Jingoo Han         2013-09-30  848  		regl->rdev = devm_regulator_register(&pdev->dev, &regl->desc,
e97bba91 Jingoo Han         2013-09-30  849  						     &config);
e515800b Axel Lin           2013-08-30  850  		if (IS_ERR(regl->rdev)) {
69ca3e58 Krystian Garbaciak 2013-07-29  851  			dev_err(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  852  				"Failed to register %s regulator\n",
69ca3e58 Krystian Garbaciak 2013-07-29  853  				regl->desc.name);
e97bba91 Jingoo Han         2013-09-30  854  			return PTR_ERR(regl->rdev);
69ca3e58 Krystian Garbaciak 2013-07-29  855  		}
69ca3e58 Krystian Garbaciak 2013-07-29  856  		id++;
69ca3e58 Krystian Garbaciak 2013-07-29  857  		n++;
69ca3e58 Krystian Garbaciak 2013-07-29  858  	}
69ca3e58 Krystian Garbaciak 2013-07-29  859  
69ca3e58 Krystian Garbaciak 2013-07-29  860  	/* LDOs overcurrent event support */
69ca3e58 Krystian Garbaciak 2013-07-29  861  	irq = platform_get_irq_byname(pdev, "LDO_LIM");
69ca3e58 Krystian Garbaciak 2013-07-29  862  	if (irq < 0) {
69ca3e58 Krystian Garbaciak 2013-07-29  863  		dev_err(&pdev->dev, "Failed to get IRQ.\n");
e97bba91 Jingoo Han         2013-09-30  864  		return irq;
69ca3e58 Krystian Garbaciak 2013-07-29  865  	}
69ca3e58 Krystian Garbaciak 2013-07-29  866  
d87aef91 Axel Lin           2015-05-31  867  	ret = devm_request_threaded_irq(&pdev->dev, irq,
69ca3e58 Krystian Garbaciak 2013-07-29  868  				NULL, da9063_ldo_lim_event,
69ca3e58 Krystian Garbaciak 2013-07-29  869  				IRQF_TRIGGER_LOW | IRQF_ONESHOT,
69ca3e58 Krystian Garbaciak 2013-07-29  870  				"LDO_LIM", regulators);
69ca3e58 Krystian Garbaciak 2013-07-29  871  	if (ret) {
d87aef91 Axel Lin           2015-05-31  872  		dev_err(&pdev->dev, "Failed to request LDO_LIM IRQ.\n");
d87aef91 Axel Lin           2015-05-31  873  		return ret;
69ca3e58 Krystian Garbaciak 2013-07-29  874  	}
69ca3e58 Krystian Garbaciak 2013-07-29  875  
69ca3e58 Krystian Garbaciak 2013-07-29  876  	return 0;
69ca3e58 Krystian Garbaciak 2013-07-29  877  }
69ca3e58 Krystian Garbaciak 2013-07-29  878  

:::::: The code at line 749 was first introduced by commit
:::::: 69ca3e58d17854f8fa72d85aea6bf4614ad25a56 regulator: da9063: Add Dialog DA9063 voltage regulators support.

:::::: TO: Krystian Garbaciak <krystian.garbaciak@...semi.com>
:::::: CC: Mark Brown <broonie@...aro.org>

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

Download attachment ".config.gz" of type "application/gzip" (29017 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ