linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: egyszeregy@freemail.hu, broonie@kernel.org,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"Benjamin Szőke" <egyszeregy@freemail.hu>
Subject: Re: [PATCH] spidev: Introduce "linux,spidev-name" property for device tree of spidev.
Date: Mon, 20 May 2024 04:35:49 +0800	[thread overview]
Message-ID: <202405200406.PHvbYk5Z-lkp@intel.com> (raw)
In-Reply-To: <20240519181039.23147-1-egyszeregy@freemail.hu>

Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on broonie-spi/for-next]
[also build test ERROR on linus/master v6.9 next-20240517]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/egyszeregy-freemail-hu/spidev-Introduce-linux-spidev-name-property-for-device-tree-of-spidev/20240520-021957
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
patch link:    https://lore.kernel.org/r/20240519181039.23147-1-egyszeregy%40freemail.hu
patch subject: [PATCH] spidev: Introduce "linux,spidev-name" property for device tree of spidev.
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240520/202405200406.PHvbYk5Z-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240520/202405200406.PHvbYk5Z-lkp@intel.com/reproduce)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405200406.PHvbYk5Z-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/spi/spidev.c:812:24: error: passing 'const struct class' to parameter of incompatible type 'const struct class *'; take the address with &
                           dev = device_create(spidev_class, &spi->dev, spidev->devt,
                                               ^~~~~~~~~~~~
                                               &
   include/linux/device.h:1175:35: note: passing argument to parameter 'cls' here
   device_create(const struct class *cls, struct device *parent, dev_t devt,
                                     ^
   drivers/spi/spidev.c:816:24: error: passing 'const struct class' to parameter of incompatible type 'const struct class *'; take the address with &
                           dev = device_create(spidev_class, &spi->dev, spidev->devt,
                                               ^~~~~~~~~~~~
                                               &
   include/linux/device.h:1175:35: note: passing argument to parameter 'cls' here
   device_create(const struct class *cls, struct device *parent, dev_t devt,
                                     ^
   2 errors generated.


vim +812 drivers/spi/spidev.c

   767	
   768	static int spidev_probe(struct spi_device *spi)
   769	{
   770		int ret;
   771		const char *name;
   772		int (*match)(struct device *dev);
   773		struct spidev_data	*spidev;
   774		int			status;
   775		unsigned long		minor;
   776	
   777		match = device_get_match_data(&spi->dev);
   778		if (match) {
   779			status = match(&spi->dev);
   780			if (status)
   781				return status;
   782		}
   783	
   784		/* Allocate driver data */
   785		spidev = kzalloc(sizeof(*spidev), GFP_KERNEL);
   786		if (!spidev)
   787			return -ENOMEM;
   788	
   789		/* Initialize the driver data */
   790		spidev->spi = spi;
   791		mutex_init(&spidev->spi_lock);
   792		mutex_init(&spidev->buf_lock);
   793	
   794		INIT_LIST_HEAD(&spidev->device_entry);
   795	
   796		/* If we can allocate a minor number, hook up this device.
   797		 * Reusing minors is fine so long as udev or mdev is working.
   798		 */
   799		mutex_lock(&device_list_lock);
   800		minor = find_first_zero_bit(minors, N_SPI_MINORS);
   801		if (minor < N_SPI_MINORS) {
   802			struct device *dev;
   803	
   804			spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
   805	
   806			/*
   807			 * If "linux,spidev-name" is specified in device tree, use /dev/spidev-<name>
   808			 * in Linux userspace, otherwise use /dev/spidev<bus_num>.<cs_num>.
   809			 */
   810			ret = device_property_read_string(&spi->dev, "linux,spidev-name", &name);
   811			if (ret < 0)
 > 812				dev = device_create(spidev_class, &spi->dev, spidev->devt,
   813						    spidev, "spidev%d.%d",
   814						    spi->controller->bus_num, spi_get_chipselect(spi, 0));
   815			else
   816				dev = device_create(spidev_class, &spi->dev, spidev->devt,
   817						    spidev, "spidev-%s", name);
   818	
   819			status = PTR_ERR_OR_ZERO(dev);
   820		} else {
   821			dev_dbg(&spi->dev, "no minor number available!\n");
   822			status = -ENODEV;
   823		}
   824		if (status == 0) {
   825			set_bit(minor, minors);
   826			list_add(&spidev->device_entry, &device_list);
   827		}
   828		mutex_unlock(&device_list_lock);
   829	
   830		spidev->speed_hz = spi->max_speed_hz;
   831	
   832		if (status == 0)
   833			spi_set_drvdata(spi, spidev);
   834		else
   835			kfree(spidev);
   836	
   837		return status;
   838	}
   839	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2024-05-19 20:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-19 18:10 [PATCH] spidev: Introduce "linux,spidev-name" property for device tree of spidev egyszeregy
2024-05-19 20:35 ` kernel test robot [this message]
2024-05-19 21:18 ` kernel test robot

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=202405200406.PHvbYk5Z-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=broonie@kernel.org \
    --cc=egyszeregy@freemail.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).