Commit ed892118 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

spi: Update swnode based SPI devices to use the fwnode name

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.
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240416100904.3738093-4-ckeepax@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8a101146
......@@ -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));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment