Re: [PATCH v2 1/3] fpga: Add Efinix Trion & Titanium serial SPI programming driver
From: Dan Carpenter
Date: Tue Jul 02 2024 - 17:27:26 EST
Hi,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/iansdannapel-gmail-com/fpga-Add-Efinix-Trion-Titanium-serial-SPI-programming-driver/20240630-044745
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20240628152348.61133-2-iansdannapel%40gmail.com
patch subject: [PATCH v2 1/3] fpga: Add Efinix Trion & Titanium serial SPI programming driver
config: powerpc-randconfig-r081-20240701 (https://download.01.org/0day-ci/archive/20240703/202407030525.VHF3He6K-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202407030525.VHF3He6K-lkp@xxxxxxxxx/
smatch warnings:
drivers/fpga/efinix-trion-spi-passive.c:174 efinix_spi_probe() warn: passing zero to 'PTR_ERR'
vim +/PTR_ERR +174 drivers/fpga/efinix-trion-spi-passive.c
4c272ecc14b70f Ian Dannapel 2024-06-28 152 static int efinix_spi_probe(struct spi_device *spi)
4c272ecc14b70f Ian Dannapel 2024-06-28 153 {
4c272ecc14b70f Ian Dannapel 2024-06-28 154 struct efinix_spi_conf *conf;
4c272ecc14b70f Ian Dannapel 2024-06-28 155 struct fpga_manager *mgr;
4c272ecc14b70f Ian Dannapel 2024-06-28 156
4c272ecc14b70f Ian Dannapel 2024-06-28 157 conf = devm_kzalloc(&spi->dev, sizeof(*conf), GFP_KERNEL);
4c272ecc14b70f Ian Dannapel 2024-06-28 158 if (!conf)
4c272ecc14b70f Ian Dannapel 2024-06-28 159 return -ENOMEM;
4c272ecc14b70f Ian Dannapel 2024-06-28 160
4c272ecc14b70f Ian Dannapel 2024-06-28 161 conf->spi = spi;
4c272ecc14b70f Ian Dannapel 2024-06-28 162
4c272ecc14b70f Ian Dannapel 2024-06-28 163 conf->creset = devm_gpiod_get(&spi->dev, "creset", GPIOD_OUT_HIGH);
4c272ecc14b70f Ian Dannapel 2024-06-28 164 if (IS_ERR(conf->creset))
4c272ecc14b70f Ian Dannapel 2024-06-28 165 return dev_err_probe(&spi->dev, PTR_ERR(conf->creset),
4c272ecc14b70f Ian Dannapel 2024-06-28 166 "Failed to get RESET gpio\n");
4c272ecc14b70f Ian Dannapel 2024-06-28 167
4c272ecc14b70f Ian Dannapel 2024-06-28 168 conf->cs = devm_gpiod_get(&spi->dev, "cs", GPIOD_OUT_HIGH);
4c272ecc14b70f Ian Dannapel 2024-06-28 169 if (IS_ERR(conf->cs))
4c272ecc14b70f Ian Dannapel 2024-06-28 170 return dev_err_probe(&spi->dev, PTR_ERR(conf->cs),
4c272ecc14b70f Ian Dannapel 2024-06-28 171 "Failed to get CHIP_SELECT gpio\n");
4c272ecc14b70f Ian Dannapel 2024-06-28 172
4c272ecc14b70f Ian Dannapel 2024-06-28 173 if (!(spi->mode & SPI_CPHA) || !(spi->mode & SPI_CPOL))
4c272ecc14b70f Ian Dannapel 2024-06-28 @174 return dev_err_probe(&spi->dev, PTR_ERR(conf->cs),
s/conf->cs/-EINVAL/
4c272ecc14b70f Ian Dannapel 2024-06-28 175 "Unsupported SPI mode, set CPHA and CPOL\n");
4c272ecc14b70f Ian Dannapel 2024-06-28 176
4c272ecc14b70f Ian Dannapel 2024-06-28 177 conf->cdone = devm_gpiod_get_optional(&spi->dev, "cdone", GPIOD_IN);
4c272ecc14b70f Ian Dannapel 2024-06-28 178 if (IS_ERR(conf->cdone))
4c272ecc14b70f Ian Dannapel 2024-06-28 179 return dev_err_probe(&spi->dev, PTR_ERR(conf->cdone),
4c272ecc14b70f Ian Dannapel 2024-06-28 180 "Failed to get CDONE gpio\n");
4c272ecc14b70f Ian Dannapel 2024-06-28 181
4c272ecc14b70f Ian Dannapel 2024-06-28 182 mgr = devm_fpga_mgr_register(&spi->dev,
4c272ecc14b70f Ian Dannapel 2024-06-28 183 "Efinix SPI Passive Programming FPGA Manager",
4c272ecc14b70f Ian Dannapel 2024-06-28 184 &efinix_spi_ops, conf);
4c272ecc14b70f Ian Dannapel 2024-06-28 185
4c272ecc14b70f Ian Dannapel 2024-06-28 186 return PTR_ERR_OR_ZERO(mgr);
4c272ecc14b70f Ian Dannapel 2024-06-28 187 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki