Re: [PATCH v3 3/3] iio: adc: add ADC driver for the TI TSC2046 controller

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

 



Hi Oleksij,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.12-rc3 next-20210319]
[cannot apply to iio/togreg]
[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/Oleksij-Rempel/mainline-ti-tsc2046-adc-driver/20210319-224746
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a74e6a014c9d4d4161061f770c9b4f98372ac778
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
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
        # https://github.com/0day-ci/linux/commit/63e96b25ae609f5659a28132f77d353cc7ecbd84
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Oleksij-Rempel/mainline-ti-tsc2046-adc-driver/20210319-224746
        git checkout 63e96b25ae609f5659a28132f77d353cc7ecbd84
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/spi/spi.h:10,
                    from drivers/iio/adc/ti-tsc2046.c:11:
   drivers/iio/adc/ti-tsc2046.c: In function 'tsc2046_adc_probe':
>> drivers/iio/adc/ti-tsc2046.c:621:16: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
     621 |   dev_err(dev, "SPI max_speed_hz is too high: %d Hz. Max supported freq is %d Hz\n",
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/iio/adc/ti-tsc2046.c:621:3: note: in expansion of macro 'dev_err'
     621 |   dev_err(dev, "SPI max_speed_hz is too high: %d Hz. Max supported freq is %d Hz\n",
         |   ^~~~~~~
   drivers/iio/adc/ti-tsc2046.c:621:77: note: format string is defined here
     621 |   dev_err(dev, "SPI max_speed_hz is too high: %d Hz. Max supported freq is %d Hz\n",
         |                                                                            ~^
         |                                                                             |
         |                                                                             int
         |                                                                            %ld

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +621 drivers/iio/adc/ti-tsc2046.c

   609	
   610	static int tsc2046_adc_probe(struct spi_device *spi)
   611	{
   612		const struct tsc2046_adc_dcfg *dcfg;
   613		struct device *dev = &spi->dev;
   614		struct tsc2046_adc_priv *priv;
   615		struct iio_dev *indio_dev;
   616		struct iio_trigger *trig;
   617		const char *name;
   618		int ret;
   619	
   620		if (spi->max_speed_hz > TI_TSC2046_MAX_CLK_FREQ) {
 > 621			dev_err(dev, "SPI max_speed_hz is too high: %d Hz. Max supported freq is %d Hz\n",
   622				spi->max_speed_hz, TI_TSC2046_MAX_CLK_FREQ);
   623			return -EINVAL;
   624		}
   625	
   626		dcfg = device_get_match_data(dev);
   627		if (!dcfg)
   628			return -EINVAL;
   629	
   630		spi->bits_per_word = 8;
   631		spi->mode &= ~SPI_MODE_X_MASK;
   632		spi->mode |= SPI_MODE_0;
   633		ret = spi_setup(spi);
   634		if (ret < 0)
   635			return dev_err_probe(dev, ret, "Error in spi setup\n");
   636	
   637		indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
   638		if (!indio_dev)
   639			return -ENOMEM;
   640	
   641		priv = iio_priv(indio_dev);
   642		priv->dcfg = dcfg;
   643	
   644		spi_set_drvdata(spi, indio_dev);
   645	
   646		priv->spi = spi;
   647	
   648		name = devm_kasprintf(dev, GFP_KERNEL, "%s-%s",
   649				      TI_TSC2046_NAME, dev_name(dev));
   650	
   651		indio_dev->name = name;
   652		indio_dev->modes = INDIO_DIRECT_MODE | INDIO_BUFFER_TRIGGERED;
   653		indio_dev->channels = dcfg->channels;
   654		indio_dev->num_channels = dcfg->num_channels;
   655		indio_dev->info = &tsc2046_adc_info;
   656	
   657		tsc2046_adc_parse_fwnode(priv);
   658	
   659		ret = tsc2046_adc_setup_spi_msg(priv);
   660		if (ret)
   661			return ret;
   662	
   663		mutex_init(&priv->slock);
   664	
   665		/* TODO: remove IRQ_NOAUTOEN after needed patches are mainline */
   666		irq_set_status_flags(spi->irq, IRQ_NOAUTOEN);
   667		ret = devm_request_irq(dev, spi->irq, &tsc2046_adc_irq,
   668				       0, name, indio_dev);
   669		if (ret)
   670			return ret;
   671	
   672		trig = devm_iio_trigger_alloc(dev, "touchscreen-%s", indio_dev->name);
   673		if (!trig)
   674			return -ENOMEM;
   675	
   676		priv->trig = trig;
   677		trig->dev.parent = indio_dev->dev.parent;
   678		iio_trigger_set_drvdata(trig, indio_dev);
   679		trig->ops = &tsc2046_adc_trigger_ops;
   680	
   681		spin_lock_init(&priv->trig_lock);
   682		hrtimer_init(&priv->trig_timer, CLOCK_MONOTONIC,
   683			     HRTIMER_MODE_REL_SOFT);
   684		priv->trig_timer.function = tsc2046_adc_trig_more;
   685	
   686		ret = devm_iio_trigger_register(dev, trig);
   687		if (ret) {
   688			dev_err(dev, "failed to register trigger\n");
   689			return ret;
   690		}
   691	
   692		ret = devm_iio_triggered_buffer_setup(dev, indio_dev, NULL,
   693						      &tsc2046_adc_trigger_handler, NULL);
   694		if (ret) {
   695			dev_err(dev, "Failed to setup triggered buffer\n");
   696			return ret;
   697		}
   698	
   699		/* set default trigger */
   700		indio_dev->trig = iio_trigger_get(priv->trig);
   701	
   702		ret = devm_iio_device_register(dev, indio_dev);
   703		if (ret) {
   704			dev_err(dev, "Failed to register iio device\n");
   705			return ret;
   706		}
   707	
   708		return 0;
   709	}
   710	

---
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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux