Skip to content

Commit

Permalink
spi: add of_device_uevent_modalias support
Browse files Browse the repository at this point in the history
Add OF support as already done for ACPI to take driver
MODULE_DEVICE_TABLE(of, ..) into account.

For example with this change a spi nor device MODALIAS changes from:

MODALIAS=spi:spi-nor

to

MODALIAS=of:Nspi-flashT(null)Cjedec,spi-nor

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20210525091003.18228-1-m.felsch@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Marco Felsch authored and broonie committed Jun 15, 2021
1 parent b2d501c commit 3ce6c9e
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 @@ -363,6 +363,10 @@ static int spi_uevent(struct device *dev, struct kobj_uevent_env *env)
const struct spi_device *spi = to_spi_device(dev);
int rc;

rc = of_device_uevent_modalias(dev, env);
if (rc != -ENODEV)
return rc;

rc = acpi_device_uevent_modalias(dev, env);
if (rc != -ENODEV)
return rc;
Expand Down

0 comments on commit 3ce6c9e

Please sign in to comment.