From cb71941a682270dd5164d1332900694d19caa5e1 Mon Sep 17 00:00:00 2001 From: David Daney Date: Tue, 22 May 2012 15:47:19 -0700 Subject: [PATCH] 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 [grant.likely: reworked because drivers/of/of_spi.c has been removed] Signed-off-by: Grant Likely --- drivers/spi/spi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) struct spi_device *spi; struct device_node *nc; const __be32 *prop; + char modalias[SPI_NAME_SIZE + 4]; int rc; int len; @@ -887,7 +888,9 @@ static void of_register_spi_devices(struct spi_master *master) spi->dev.of_node = nc; /* Register the new device */ - request_module(spi->modalias); + snprintf(modalias, sizeof(modalias), "%s%s", SPI_MODULE_PREFIX, + spi->modalias); + request_module(modalias); rc = spi_add_device(spi); if (rc) { dev_err(&master->dev, "spi_device register error %s\n",