LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Marek Vasut <marek.vasut@gmail.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
	Steve Twiss <stwiss.opensource@diasemi.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 2/6] mfd: da9063: Replace model with type
Date: Sat, 26 May 2018 17:16:35 +0800	[thread overview]
Message-ID: <201805261713.OJMLXvlB%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180523114230.10109-2-marek.vasut+renesas@gmail.com>

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

Hi Marek,

I love your patch! Perhaps something to improve:

[auto build test WARNING on ljones-mfd/for-mfd-next]
[also build test WARNING on v4.17-rc6]
[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-Rename-PMIC_DA9063-to-PMIC_CHIP_ID_DA9063/20180526-162613
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: x86_64-randconfig-x002-201820 (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=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10:0,
                    from drivers//regulator/da9063-regulator.c:16:
   drivers//regulator/da9063-regulator.c: In function 'da9063_regulator_probe':
   drivers//regulator/da9063-regulator.c:744:12: error: 'const struct da9063_dev_model' has no member named 'dev_model'
      if (model->dev_model == da9063->type)
               ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers//regulator/da9063-regulator.c:744:3: note: in expansion of macro 'if'
      if (model->dev_model == da9063->type)
      ^~
   drivers//regulator/da9063-regulator.c:744:12: error: 'const struct da9063_dev_model' has no member named 'dev_model'
      if (model->dev_model == da9063->type)
               ^
   include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
>> drivers//regulator/da9063-regulator.c:744:3: note: in expansion of macro 'if'
      if (model->dev_model == da9063->type)
      ^~
   drivers//regulator/da9063-regulator.c:744:12: error: 'const struct da9063_dev_model' has no member named 'dev_model'
      if (model->dev_model == da9063->type)
               ^
   include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
>> drivers//regulator/da9063-regulator.c:744:3: note: in expansion of macro 'if'
      if (model->dev_model == da9063->type)
      ^~
   drivers//regulator/da9063-regulator.c:749:10: error: 'struct da9063' has no member named 'model'
       da9063->model);
             ^~

vim +/if +744 drivers//regulator/da9063-regulator.c

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

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

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

  parent reply	other threads:[~2018-05-26  9:17 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 11:42 [PATCH 1/6] mfd: da9063: Rename PMIC_DA9063 to PMIC_CHIP_ID_DA9063 Marek Vasut
2018-05-23 11:42 ` [PATCH 2/6] mfd: da9063: Replace model with type Marek Vasut
2018-05-23 11:50   ` Mark Brown
2018-05-23 11:55   ` Geert Uytterhoeven
2018-05-23 12:15     ` Marek Vasut
2018-05-26  9:16   ` kbuild test robot [this message]
2018-05-26  9:58     ` Marek Vasut
2018-05-30  5:21       ` Ye Xiaolong
2018-05-30 10:45         ` Marek Vasut
2018-05-26 11:01   ` kbuild test robot
2018-05-23 11:42 ` [PATCH 3/6] mfd: da9063: Add DA9063L type Marek Vasut
2018-05-23 12:00   ` Geert Uytterhoeven
2018-05-24 13:06   ` Steve Twiss
2018-05-23 11:42 ` [PATCH 4/6] mfd: da9063: Disallow RTC on DA9063L Marek Vasut
2018-05-23 12:00   ` Geert Uytterhoeven
2018-05-24 12:50   ` Steve Twiss
2018-05-29  7:55     ` Lee Jones
2018-05-30 10:59       ` Marek Vasut
2018-05-23 11:42 ` [PATCH 5/6] mfd: da9063: Handle less LDOs " Marek Vasut
2018-05-23 11:50   ` Mark Brown
2018-05-23 12:05   ` Geert Uytterhoeven
2018-05-23 11:42 ` [PATCH 6/6] mfd: da9063: Add DA9063L support Marek Vasut
2018-05-23 11:50   ` Mark Brown
2018-05-23 12:06   ` Geert Uytterhoeven
2018-05-24 11:48   ` Steve Twiss
2018-05-24 12:32     ` Steve Twiss
2018-05-24 14:50       ` Marek Vasut
2018-05-24 17:30         ` Steve Twiss
2018-05-30 11:24           ` Marek Vasut
2018-05-31 12:45             ` Steve Twiss
2018-06-02  9:59               ` Marek Vasut
2018-05-29  7:46         ` Lee Jones
2018-05-30 11:26           ` Marek Vasut
2018-05-23 11:49 ` [PATCH 1/6] mfd: da9063: Rename PMIC_DA9063 to PMIC_CHIP_ID_DA9063 Mark Brown
2018-05-23 11:53 ` Geert Uytterhoeven
2018-05-24 12:03 ` Steve Twiss

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=201805261713.OJMLXvlB%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=kbuild-all@01.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=marek.vasut@gmail.com \
    --cc=stwiss.opensource@diasemi.com \
    --cc=wsa+renesas@sang-engineering.com \
    --subject='Re: [PATCH 2/6] mfd: da9063: Replace model with type' \
    /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

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).