Skip to content

Commit

Permalink
spi: update modalias_show after of_device_uevent_modalias support
Browse files Browse the repository at this point in the history
Commit 3ce6c9e ("spi: add of_device_uevent_modalias support") is
incomplete, as it didn't update the modalias_show function to generate the
of: modalias string if available.

Fixes: 3ce6c9e ("spi: add of_device_uevent_modalias support")
Signed-off-by: Andreas Schwab <schwab@suse.de>
Link: https://lore.kernel.org/r/mvmwnpi4fya.fsf@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Andreas Schwab authored and Mark Brown committed Jul 22, 2021
1 parent 8311ee2 commit e09f2ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ modalias_show(struct device *dev, struct device_attribute *a, char *buf)
const struct spi_device *spi = to_spi_device(dev);
int len;

len = of_device_modalias(dev, buf, PAGE_SIZE);
if (len != -ENODEV)
return len;

len = acpi_device_modalias(dev, buf, PAGE_SIZE - 1);
if (len != -ENODEV)
return len;
Expand Down

0 comments on commit e09f2ab

Please sign in to comment.