Re: [PATCH v2 1/2] iio:adc:ad7476: Handle the different regulators used by various parts.

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

 



Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on iio/togreg]
[also build test ERROR on v5.12-rc6 next-20210401]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/iio-adc-ad7476-Regulator-support-and-binding-doc/20210406-002735
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: riscv-randconfig-r004-20210405 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 2760a808b9916a2839513b7fd7314a464f52481e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/0c18d053103b05b990e986b54c77a32db4f3f9f4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jonathan-Cameron/iio-adc-ad7476-Regulator-support-and-binding-doc/20210406-002735
        git checkout 0c18d053103b05b990e986b54c77a32db4f3f9f4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/iio/adc/ad7476.c:418:24: error: no member named 'reg' in 'struct ad7476_state'
           regulator_disable(st->reg);
                             ~~  ^
   1 error generated.


vim +418 drivers/iio/adc/ad7476.c

4bb2b8f94ace32 drivers/iio/adc/ad7476.c              Beniamin Bia       2020-03-11  304  
fc52692c49969e drivers/iio/adc/ad7476.c              Greg Kroah-Hartman 2012-12-21  305  static int ad7476_probe(struct spi_device *spi)
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  306  {
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  307  	struct ad7476_state *st;
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  308  	struct iio_dev *indio_dev;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  309  	struct regulator *reg;
cb093e444fede7 drivers/staging/iio/adc/ad7476_core.c Lars-Peter Clausen 2012-09-10  310  	int ret;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  311  
4ea454d2c1a38d drivers/iio/adc/ad7476.c              Sachin Kamat       2013-07-23  312  	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
4ea454d2c1a38d drivers/iio/adc/ad7476.c              Sachin Kamat       2013-07-23  313  	if (!indio_dev)
4ea454d2c1a38d drivers/iio/adc/ad7476.c              Sachin Kamat       2013-07-23  314  		return -ENOMEM;
4ea454d2c1a38d drivers/iio/adc/ad7476.c              Sachin Kamat       2013-07-23  315  
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  316  	st = iio_priv(indio_dev);
cb093e444fede7 drivers/staging/iio/adc/ad7476_core.c Lars-Peter Clausen 2012-09-10  317  	st->chip_info =
cb093e444fede7 drivers/staging/iio/adc/ad7476_core.c Lars-Peter Clausen 2012-09-10  318  		&ad7476_chip_info_tbl[spi_get_device_id(spi)->driver_data];
cb093e444fede7 drivers/staging/iio/adc/ad7476_core.c Lars-Peter Clausen 2012-09-10  319  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  320  	reg = devm_regulator_get(&spi->dev, "vcc");
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  321  	if (IS_ERR(reg))
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  322  		return PTR_ERR(reg);
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  323  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  324  	ret = regulator_enable(reg);
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  325  	if (ret)
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  326  		return ret;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  327  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  328  	ret = devm_add_action_or_reset(&spi->dev, ad7476_reg_disable, reg);
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  329  	if (ret)
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  330  		return ret;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  331  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  332  	/* Either vcc or vref (below) as appropriate */
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  333  	st->ref_reg = reg;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  334  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  335  	if (st->chip_info->has_vref) {
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  336  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  337  		/* If a device has an internal reference vref is optional */
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  338  		if (st->chip_info->int_vref_uv) {
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  339  			reg = devm_regulator_get_optional(&spi->dev, "vref");
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  340  		} else {
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  341  			reg = devm_regulator_get(&spi->dev, "vref");
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  342  			if (IS_ERR(reg))
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  343  				return PTR_ERR(reg);
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  344  		}
cb093e444fede7 drivers/staging/iio/adc/ad7476_core.c Lars-Peter Clausen 2012-09-10  345  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  346  		if (!IS_ERR(reg)) {
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  347  			ret = regulator_enable(reg);
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  348  			if (ret)
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  349  				return ret;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  350  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  351  			ret = devm_add_action_or_reset(&spi->dev,
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  352  						       ad7476_reg_disable,
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  353  						       reg);
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  354  			if (ret)
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  355  				return ret;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  356  			st->ref_reg = reg;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  357  			st->force_ext_vref = true;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  358  		}
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  359  	}
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  360  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  361  	if (st->chip_info->has_vdrive) {
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  362  		reg = devm_regulator_get(&spi->dev, "vdrive");
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  363  		if (IS_ERR(reg))
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  364  			return PTR_ERR(reg);
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  365  
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  366  		ret = regulator_enable(reg);
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  367  		if (ret)
4ea454d2c1a38d drivers/iio/adc/ad7476.c              Sachin Kamat       2013-07-23  368  			return ret;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  369  
4bb2b8f94ace32 drivers/iio/adc/ad7476.c              Beniamin Bia       2020-03-11  370  		ret = devm_add_action_or_reset(&spi->dev, ad7476_reg_disable,
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  371  					       reg);
4bb2b8f94ace32 drivers/iio/adc/ad7476.c              Beniamin Bia       2020-03-11  372  		if (ret)
4bb2b8f94ace32 drivers/iio/adc/ad7476.c              Beniamin Bia       2020-03-11  373  			return ret;
0c18d053103b05 drivers/iio/adc/ad7476.c              Jonathan Cameron   2021-04-05  374  	}
4bb2b8f94ace32 drivers/iio/adc/ad7476.c              Beniamin Bia       2020-03-11  375  
af37e4703d00ce drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  376  	st->convst_gpio = devm_gpiod_get_optional(&spi->dev,
af37e4703d00ce drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  377  						  "adi,conversion-start",
af37e4703d00ce drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  378  						  GPIOD_OUT_LOW);
af37e4703d00ce drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  379  	if (IS_ERR(st->convst_gpio))
af37e4703d00ce drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  380  		return PTR_ERR(st->convst_gpio);
af37e4703d00ce drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  381  
38f71aa905c20c drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-07-13  382  	spi_set_drvdata(spi, indio_dev);
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  383  
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  384  	st->spi = spi;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  385  
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  386  	indio_dev->name = spi_get_device_id(spi)->name;
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  387  	indio_dev->modes = INDIO_DIRECT_MODE;
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  388  	indio_dev->channels = st->chip_info->channel;
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  389  	indio_dev->num_channels = 2;
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  390  	indio_dev->info = &ad7476_info;
3a6af93dd66eba drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  391  
a66904b209b6d8 drivers/iio/adc/ad7476.c              Colin Ian King     2020-04-24  392  	if (st->convst_gpio)
3a6af93dd66eba drivers/iio/adc/ad7476.c              Dragos Bogdan      2020-03-11  393  		indio_dev->channels = st->chip_info->convst_channel;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  394  	/* Setup default message */
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  395  
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  396  	st->xfer.rx_buf = &st->data;
c5e0819e2d82c7 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-05-18  397  	st->xfer.len = st->chip_info->channel[0].scan_type.storagebits / 8;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  398  
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  399  	spi_message_init(&st->msg);
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  400  	spi_message_add_tail(&st->xfer, &st->msg);
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  401  
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c      Lars-Peter Clausen 2012-09-10  402  	ret = iio_triggered_buffer_setup(indio_dev, NULL,
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c      Lars-Peter Clausen 2012-09-10  403  			&ad7476_trigger_handler, NULL);
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  404  	if (ret)
67688105af8376 drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-06-27  405  		goto error_disable_reg;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  406  
87c5b10fd97937 drivers/iio/adc/ad7476.c              Lars-Peter Clausen 2012-09-17  407  	if (st->chip_info->reset)
87c5b10fd97937 drivers/iio/adc/ad7476.c              Lars-Peter Clausen 2012-09-17  408  		st->chip_info->reset(st);
87c5b10fd97937 drivers/iio/adc/ad7476.c              Lars-Peter Clausen 2012-09-17  409  
26d25ae3f0d8ff drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-09-02  410  	ret = iio_device_register(indio_dev);
26d25ae3f0d8ff drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-09-02  411  	if (ret)
26d25ae3f0d8ff drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-09-02  412  		goto error_ring_unregister;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  413  	return 0;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  414  
26d25ae3f0d8ff drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-09-02  415  error_ring_unregister:
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c      Lars-Peter Clausen 2012-09-10  416  	iio_triggered_buffer_cleanup(indio_dev);
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  417  error_disable_reg:
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11 @418  	regulator_disable(st->reg);
26d25ae3f0d8ff drivers/staging/iio/adc/ad7476_core.c Jonathan Cameron   2011-09-02  419  
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  420  	return ret;
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  421  }
349282d82e929e drivers/staging/iio/adc/ad7476_core.c Michael Hennerich  2010-10-11  422  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux