From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Santos <Jonathan.Santos@analog.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com,
michael.hennerich@analog.com, broonie@kernel.org,
jonath4nns@gmail.com, marcelo.schmitt1@gmail.com
Subject: Re: [PATCH v3 3/6] spi: expand device name to include all CS lines for multi-CS devices
Date: Tue, 18 Aug 2026 09:45:05 +0300 [thread overview]
Message-ID: <aoP_cbcqHEA5L7iK@ashevche-desk.local> (raw)
In-Reply-To: <5719698587a0a7658a3980168eef0731a5e7506a.1786973376.git.Jonathan.Santos@analog.com>
On Mon, Aug 17, 2026 at 08:32:57PM -0300, Jonathan Santos wrote:
> The device name for SPI devices was formatted as <controller>.<cs0>,
> always using only the first chip-select index, ignoring the remaining CS
> lines.
>
> Change the naming format to <controller>.<cs0>+<cs1>+... so that all
> active chip-selects are reflected in the device name. Single-CS devices
> are not affected since the loop only appends extra indices when
> num_chipselect is greater than one.
...
> - dev_set_name(&spi->dev, "%s.%u", dev_name(&spi->controller->dev),
> - spi_get_chipselect(spi, 0));
> + cs_len = scnprintf(cs_str, sizeof(cs_str), "%u", spi_get_chipselect(spi, 0));
> + for (unsigned int idx = 1; idx < spi->num_chipselect; idx++)
> + cs_len += scnprintf(cs_str + cs_len, sizeof(cs_str) - cs_len,
> + "+%u", spi_get_chipselect(spi, idx));
So, if this won't support sparse CS list, I would just go with a standard range:
dev_set_name(&spi->dev, "%s.%u-%u", dev_name(&spi->controller->dev),
spi_get_chipselect(spi, 0), spi_get_chipselect(spi, 0) + spi->num_chipselect - 1);
(yes, need a variation for num_chipselect == 1, but I leave the rest for you)
Note, I do not see that we are expecting to see the sparse CS list here. It
would make too complex logic to follow. So, range approach is KISS in my opinion.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-08-18 6:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 23:32 [PATCH v3 0/6] spi: add multi-CS and multi-chip aggregation support Jonathan Santos
2026-08-17 23:32 ` [PATCH v3 1/6] dt-bindings: iio: adc: ad7768-1: Document multidevice support Jonathan Santos
2026-08-18 6:46 ` Krzysztof Kozlowski
2026-08-18 13:35 ` David Lechner
2026-08-18 15:02 ` David Lechner
2026-08-18 15:14 ` Nuno Sá
2026-08-18 15:26 ` David Lechner
2026-08-17 23:32 ` [PATCH v3 2/6] spi: support simultaneous assertion of multiple CS Jonathan Santos
2026-08-18 6:39 ` Andy Shevchenko
2026-08-18 16:06 ` David Lechner
2026-08-22 0:10 ` Jonathan Santos
2026-08-17 23:32 ` [PATCH v3 3/6] spi: expand device name to include all CS lines for multi-CS devices Jonathan Santos
2026-08-18 6:45 ` Andy Shevchenko [this message]
2026-08-18 16:14 ` Nuno Sá
2026-08-19 6:59 ` Andy Shevchenko
2026-08-17 23:33 ` [PATCH v3 4/6] spi: introduce SPI ancillary device with lanes Jonathan Santos
2026-08-18 6:53 ` Andy Shevchenko
2026-08-17 23:33 ` [PATCH v3 5/6] spi: spi-engine-ex: Add support for multi-CS devices Jonathan Santos
2026-08-18 7:01 ` Andy Shevchenko
2026-08-17 23:33 ` [PATCH v3 6/6] iio: adc: ad7768-1: add support for multiple chip aggregation Jonathan Santos
2026-08-18 7:10 ` Andy Shevchenko
2026-08-18 16:17 ` Nuno Sá
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=aoP_cbcqHEA5L7iK@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=Jonathan.Santos@analog.com \
--cc=broonie@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jonath4nns@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=michael.hennerich@analog.com \
--cc=nuno.sa@analog.com \
/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