Re: [PATCH v3] staging: wfx: Get descriptors for GPIOs

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

 



Hi Linus,

I love your patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Linus-Walleij/staging-wfx-Get-descriptors-for-GPIOs/20200628-165448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 5bfb7eadc5874a3a08dd173d66a16a1ed0548444
config: sh-allyesconfig (attached as .config)
compiler: sh4-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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh 

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/staging/wfx/bus_spi.c: In function 'wfx_spi_probe':
>> drivers/staging/wfx/bus_spi.c:209:63: error: expected ')' before 'GPIOD_OUT_HIGH'
     209 |  bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset"
         |                                                               ^
         |                                                               )
     210 |         GPIOD_OUT_HIGH);
         |         ~~~~~~~~~~~~~~                                         
>> drivers/staging/wfx/bus_spi.c:209:20: error: too few arguments to function 'devm_gpiod_get_optional'
     209 |  bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset"
         |                    ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/staging/wfx/bus_spi.c:11:
   include/linux/gpio/consumer.h:95:32: note: declared here
      95 | struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,
         |                                ^~~~~~~~~~~~~~~~~~~~~~~

vim +209 drivers/staging/wfx/bus_spi.c

   179	
   180	static int wfx_spi_probe(struct spi_device *func)
   181	{
   182		struct wfx_spi_priv *bus;
   183		int ret;
   184	
   185		if (!func->bits_per_word)
   186			func->bits_per_word = 16;
   187		ret = spi_setup(func);
   188		if (ret)
   189			return ret;
   190		// Trace below is also displayed by spi_setup() if compiled with DEBUG
   191		dev_dbg(&func->dev, "SPI params: CS=%d, mode=%d bits/word=%d speed=%d\n",
   192			func->chip_select, func->mode, func->bits_per_word,
   193			func->max_speed_hz);
   194		if (func->bits_per_word != 16 && func->bits_per_word != 8)
   195			dev_warn(&func->dev, "unusual bits/word value: %d\n",
   196				 func->bits_per_word);
   197		if (func->max_speed_hz > 50000000)
   198			dev_warn(&func->dev, "%dHz is a very high speed\n",
   199				 func->max_speed_hz);
   200	
   201		bus = devm_kzalloc(&func->dev, sizeof(*bus), GFP_KERNEL);
   202		if (!bus)
   203			return -ENOMEM;
   204		bus->func = func;
   205		if (func->bits_per_word == 8 || IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
   206			bus->need_swab = true;
   207		spi_set_drvdata(func, bus);
   208	
 > 209		bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset"
   210							  GPIOD_OUT_HIGH);
   211		if (IS_ERR(bus->gpio_reset))
   212			return PTR_ERR(bus->gpio_reset);
   213		if (!bus->gpio_reset) {
   214			dev_warn(&func->dev, "try to load firmware anyway\n");
   215		} else {
   216			gpiod_set_consumer_name(bus->gpio_reset, "wfx reset");
   217			if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED)
   218				gpiod_toggle_active_low(bus->gpio_reset);
   219			gpiod_set_value_cansleep(bus->gpio_reset, 1);
   220			usleep_range(100, 150);
   221			gpiod_set_value_cansleep(bus->gpio_reset, 0);
   222			usleep_range(2000, 2500);
   223		}
   224	
   225		bus->core = wfx_init_common(&func->dev, &wfx_spi_pdata,
   226					    &wfx_spi_hwbus_ops, bus);
   227		if (!bus->core)
   228			return -EIO;
   229	
   230		return wfx_probe(bus->core);
   231	}
   232	

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux