aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2024-04-16 11:09:02 +0100
committerMark Brown <broonie@kernel.org>2024-04-16 20:00:27 +0900
commit8a101146bcf014060530d71eba8edc52eca257f7 (patch)
treea2709d0ae185c861d511abd3e24c0dfd8b91b946
parent9d50f95bc0d5df56f2591b950a251d90bffad094 (diff)
downloadspi-8a101146bcf014060530d71eba8edc52eca257f7.tar.gz
spi: Switch to using is_acpi_device_node() in spi_dev_set_name()
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> Link: https://lore.kernel.org/r/20240416100904.3738093-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ff75838c1b5df..26f287d8d9463 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;
}