From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>, <linus.walleij@linaro.org>, <brgl@bgdev.pl>
Cc: <andy.shevchenko@gmail.com>, <bard.liao@intel.com>,
<linux-gpio@vger.kernel.org>, <linux-spi@vger.kernel.org>,
<patches@opensource.cirrus.com>
Subject: [PATCH v6 3/4] spi: Update swnode based SPI devices to use the fwnode name
Date: Mon, 15 Apr 2024 15:09:24 +0100 [thread overview]
Message-ID: <20240415140925.3518990-4-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20240415140925.3518990-1-ckeepax@opensource.cirrus.com>
Update the name for software node based SPI devices to use the fwnode
name as the device name. This is helpful since swnode devices are
usually added within the kernel, and the kernel often then requires a
predictable name such that it can refer back to the device.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
Series changes since v5:
- Use %pwfP to get firmware node name
Thanks,
Charles
drivers/spi/spi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d1f82a35f2d0..4fcaadf8a484 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -605,6 +605,11 @@ static void spi_dev_set_name(struct spi_device *spi)
return;
}
+ if (is_software_node(fwnode)) {
+ dev_set_name(dev, "spi-%pfwP", fwnode);
+ return;
+ }
+
dev_set_name(&spi->dev, "%s.%u", dev_name(&spi->controller->dev),
spi_get_chipselect(spi, 0));
}
--
2.39.2
next prev parent reply other threads:[~2024-04-15 14:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 14:09 [PATCH v6 0/4] Add bridged amplifiers to cs42l43 Charles Keepax
2024-04-15 14:09 ` [PATCH v6 1/4] gpio: swnode: Add ability to specify native chip selects for SPI Charles Keepax
2024-04-15 16:05 ` Andy Shevchenko
2024-04-16 21:09 ` Bartosz Golaszewski
2024-04-15 14:09 ` [PATCH v6 2/4] spi: Switch to using is_acpi_device_node() in spi_dev_set_name() Charles Keepax
2024-04-15 16:06 ` Andy Shevchenko
2024-04-16 9:53 ` Charles Keepax
2024-04-15 14:09 ` Charles Keepax [this message]
2024-04-15 16:09 ` [PATCH v6 3/4] spi: Update swnode based SPI devices to use the fwnode name Andy Shevchenko
2024-04-15 14:09 ` [PATCH v6 4/4] spi: cs42l43: Add bridged cs35l56 amplifiers Charles Keepax
2024-04-15 16:17 ` Andy Shevchenko
2024-04-16 9:54 ` Charles Keepax
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=20240415140925.3518990-4-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=andy.shevchenko@gmail.com \
--cc=bard.liao@intel.com \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=patches@opensource.cirrus.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.