From: Marco Felsch <m.felsch@pengutronix.de>
To: broonie@kernel.org
Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH v1] spi: add of_device_uevent_modalias support
Date: Tue, 25 May 2021 11:10:03 +0200 [thread overview]
Message-ID: <20210525091003.18228-1-m.felsch@pengutronix.de> (raw)
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>
---
drivers/spi/spi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 0cab239d8e7f..82078226c460 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -367,6 +367,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;
--
2.29.2
next reply other threads:[~2021-05-25 9:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 9:10 Marco Felsch [this message]
2021-06-04 15:45 ` [PATCH v1] spi: add of_device_uevent_modalias support Mark Brown
2021-06-09 8:07 ` Marco Felsch
2021-06-15 12:06 ` Mark Brown
2021-07-22 13:48 ` [PATCH] spi: update modalias_show after " Andreas Schwab
2021-07-22 14:06 ` Mark Brown
2021-07-22 17:09 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210525091003.18228-1-m.felsch@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=broonie@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).