aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorDavid Daney <david.daney@cavium.com>2012-05-22 18:47:19 -0400
committerGrant Likely <grant.likely@secretlab.ca>2012-12-14 19:49:35 -0500
commitcb71941a682270dd5164d1332900694d19caa5e1 (patch)
tree20964fd5de0ccda5cff4cf6e5a0057d5f4bb29d1 /drivers/spi
parent7d859ff4937a22aabc0d3f352d1f515fb8b38528 (diff)
of/spi: Fix SPI module loading by using proper "spi:" modalias prefixes.
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> [grant.likely: reworked because drivers/of/of_spi.c has been removed] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ab095acdb2a8..19ee901577da 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -824,6 +824,7 @@ static void of_register_spi_devices(struct spi_master *master)
824 struct spi_device *spi; 824 struct spi_device *spi;
825 struct device_node *nc; 825 struct device_node *nc;
826 const __be32 *prop; 826 const __be32 *prop;
827 char modalias[SPI_NAME_SIZE + 4];
827 int rc; 828 int rc;
828 int len; 829 int len;
829 830
@@ -887,7 +888,9 @@ static void of_register_spi_devices(struct spi_master *master)
887 spi->dev.of_node = nc; 888 spi->dev.of_node = nc;
888 889
889 /* Register the new device */ 890 /* Register the new device */
890 request_module(spi->modalias); 891 snprintf(modalias, sizeof(modalias), "%s%s", SPI_MODULE_PREFIX,
892 spi->modalias);
893 request_module(modalias);
891 rc = spi_add_device(spi); 894 rc = spi_add_device(spi);
892 if (rc) { 895 if (rc) {
893 dev_err(&master->dev, "spi_device register error %s\n", 896 dev_err(&master->dev, "spi_device register error %s\n",