linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 v7 2/4] spi: Switch to using is_acpi_device_node() in spi_dev_set_name()
Date: Tue, 16 Apr 2024 11:09:02 +0100	[thread overview]
Message-ID: <20240416100904.3738093-3-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20240416100904.3738093-1-ckeepax@opensource.cirrus.com>

Use is_acpi_device_node() rather than checking ACPI_COMPANION(), such
that when checking for other types of firmware node, the code can
consistently do checks against the fwnode.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---

No changes since v6.

Thanks,
Charles

 drivers/spi/spi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index a2f01116ba09..d1f82a35f2d0 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -597,10 +597,11 @@ EXPORT_SYMBOL_GPL(spi_alloc_device);
 
 static void spi_dev_set_name(struct spi_device *spi)
 {
-	struct acpi_device *adev = ACPI_COMPANION(&spi->dev);
+	struct device *dev = &spi->dev;
+	struct fwnode_handle *fwnode = dev_fwnode(dev);
 
-	if (adev) {
-		dev_set_name(&spi->dev, "spi-%s", acpi_dev_name(adev));
+	if (is_acpi_device_node(fwnode)) {
+		dev_set_name(dev, "spi-%s", acpi_dev_name(to_acpi_device_node(fwnode)));
 		return;
 	}
 
-- 
2.39.2


  parent reply	other threads:[~2024-04-16 10:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 10:09 [PATCH v7 0/4] Add bridged amplifiers to cs42l43 Charles Keepax
2024-04-16 10:09 ` [PATCH v7 1/4] gpio: swnode: Add ability to specify native chip selects for SPI Charles Keepax
2024-04-16 10:09 ` Charles Keepax [this message]
2024-04-16 10:09 ` [PATCH v7 3/4] spi: Update swnode based SPI devices to use the fwnode name Charles Keepax
2024-04-16 10:09 ` [PATCH v7 4/4] spi: cs42l43: Add bridged cs35l56 amplifiers Charles Keepax
2024-04-16 13:40   ` Andy Shevchenko
2024-04-16 14:08     ` Charles Keepax
2024-04-17  2:46 ` [PATCH v7 0/4] Add bridged amplifiers to cs42l43 Mark Brown

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=20240416100904.3738093-3-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 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).