]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
spi: simplify call to request_module()
authorMathias Krause <minipli@googlemail.com>
Sat, 31 Aug 2013 18:24:14 +0000 (20:24 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 3 Sep 2013 10:08:13 +0000 (11:08 +0100)
request_module() can handle format strings on its own, no need to create
the full module name ourself.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi.c

index f56017ea55e92c909bb4f0bb3b179f6a6fe08853..789ac9428be091133b75ac60ca60b46f230d4f41 100644 (file)
@@ -823,7 +823,6 @@ 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,9 +886,7 @@ static void of_register_spi_devices(struct spi_master *master)
                spi->dev.of_node = nc;
 
                /* Register the new device */
-               snprintf(modalias, sizeof(modalias), "%s%s", SPI_MODULE_PREFIX,
-                        spi->modalias);
-               request_module(modalias);
+               request_module("%s%s", SPI_MODULE_PREFIX, spi->modalias);
                rc = spi_add_device(spi);
                if (rc) {
                        dev_err(&master->dev, "spi_device register error %s\n",