Re: [PATCH v6 1/2] spi: add new_device/delete_device sysfs interface
From: Mark Brown
Date: Mon Jul 27 2026 - 11:04:13 EST
On Tue, Jul 14, 2026 at 10:09:43AM +0000, Vishwaroop A wrote:
> Development boards such as the Jetson AGX Orin expose SPI buses
> on expansion headers (e.g. the 40-pin header) so that users can
> connect and interact with SPI peripherals from userspace. The
> standard way to get /dev/spidevB.C character device nodes for
> this purpose is to register spi_device instances backed by the
> spidev driver.
> +new_device_store(struct device *dev, struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + if (blank - buf > SPI_NAME_SIZE - 1) {
> + dev_err(dev, "%s: Invalid device name\n", "new_device");
> + return -EINVAL;
> + }
What about empty names (" 0")?
> static const struct attribute_group *spi_controller_groups[] = {
> &spi_controller_statistics_group,
> + &spi_controller_userspace_group,
> NULL,
> };
It looks like there's an issue with cleanup here when a controller is
probing, the userspace interface will appear when the device is
registered but that's part way through setting up the controller, before
we've finished sitting up the devices from the firmware and the queue.
We probably need to manually register this as the last step of
controller bringup, we can't defer the device for long enough as we need
it to create the children.
Attachment:
signature.asc
Description: PGP signature