diff options
author | Marco Felsch <m.felsch@pengutronix.de> | 2021-05-25 11:10:03 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-15 12:43:16 +0200 |
commit | 3ce6c9e2617ebc09b2d55cc88134b90c19ff6d31 (patch) | |
tree | fc5c8fe21a83841cdb3239d15775394a03dd75f5 /drivers/spi | |
parent | spi: meson-spicc: fix memory leak in meson_spicc_probe (diff) | |
download | linux-3ce6c9e2617ebc09b2d55cc88134b90c19ff6d31.tar.xz linux-3ce6c9e2617ebc09b2d55cc88134b90c19ff6d31.zip |
spi: add of_device_uevent_modalias support
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index a0a232669dc1..8553e7d48f66 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -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; |