From: David Daney <ddaney.cavm@gmail.com>
To: Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
Subject: of/spi: Supply proper "spi:" modalias prefixes.
Date: Tue, 22 May 2012 15:47:19 -0700 [thread overview]
Message-ID: <1337726839-7710-1-git-send-email-ddaney.cavm@gmail.com> (raw)
From: David Daney <david.daney@cavium.com>
To get modprobe to automatically load the proper modules, we need to
prefix things with "spi:". Partially based on Grant Likely's suggestions.
Signed-off-by: David Daney <david.daney@cavium.com>
---
drivers/of/of_spi.c | 6 +++++-
drivers/spi/spi.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/of/of_spi.c b/drivers/of/of_spi.c
index 6dbc074..3486d2d 100644
--- a/drivers/of/of_spi.c
+++ b/drivers/of/of_spi.c
@@ -25,6 +25,7 @@ void of_register_spi_devices(struct spi_master *master)
struct spi_device *spi;
struct device_node *nc;
const __be32 *prop;
+ char request_module_modalias[SPI_NAME_SIZE + 4];
int rc;
int len;
@@ -86,7 +87,10 @@ void of_register_spi_devices(struct spi_master *master)
spi->dev.of_node = nc;
/* Register the new device */
- request_module(spi->modalias);
+ snprintf(request_module_modalias,
+ sizeof(request_module_modalias),
+ "%s%s", SPI_MODULE_PREFIX, spi->modalias);
+ request_module(request_module_modalias);
rc = spi_add_device(spi);
if (rc) {
dev_err(&master->dev, "spi_device register error %s\n",
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3d8f662..da8aac7 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -51,7 +51,7 @@ modalias_show(struct device *dev, struct device_attribute *a, char *buf)
{
const struct spi_device *spi = to_spi_device(dev);
- return sprintf(buf, "%s\n", spi->modalias);
+ return sprintf(buf, "%s%s\n", SPI_MODULE_PREFIX, spi->modalias);
}
static struct device_attribute spi_dev_attrs[] = {
next reply other threads:[~2012-05-22 22:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-22 22:47 David Daney [this message]
2012-05-22 23:14 ` Grant Likely
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=1337726839-7710-1-git-send-email-ddaney.cavm@gmail.com \
--to=ddaney.cavm@gmail.com \
--cc=david.daney@cavium.com \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=spi-devel-general@lists.sourceforge.net \
/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
Powered by JetHome