Skip to content

Commit

Permalink
of/spi: Fix SPI module loading by using proper "spi:" modalias prefixes.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Daney authored and Grant Likely committed Dec 15, 2012
1 parent 7d859ff commit cb71941
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit cb71941

Please sign in to comment.