]> err.no Git - linux-2.6/commitdiff
SPI driver hotplug/coldplug fixes
authorDavid Brownell <david-b@pacbell.net>
Fri, 31 Aug 2007 06:56:24 +0000 (23:56 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 31 Aug 2007 08:42:22 +0000 (01:42 -0700)
Update various SPI drivers so they properly support

  - coldplug through "modprobe $(cat /sys/devices/.../modalias)"

  - hotplug through "modprobe $(MODALIAS)"

The basic rule for platform, SPI, and (new style) I2C drivers is just
to make sure that modprobing the driver name works.  In this case, all
the relevant drivers are platform drivers, and this patch either

  (a) Changes the driver name, if no in-tree code would break;
this is simpler and thus preferable in the long term.

  (b) Adds MODULE_ALIAS directives, when in-tree platforms declare
devices using the current driver name; less desirable.

Most systems will link SPI controller drivers statically, but
there's no point in being needlessly broken.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Jean Delvare <khali@linux-fr.org>
Acked-by: Andrei Konovalov <akonovalov@ru.mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/spi_bfin5xx.c
drivers/spi/spi_imx.c
drivers/spi/spi_mpc83xx.c
drivers/spi/spi_s3c24xx.c
drivers/spi/spi_s3c24xx_gpio.c
drivers/spi/spi_txx9.c
drivers/spi/xilinx_spi.c

index 48587c27050d335fb083d9ea989181a50c7063a3..f540ed77a1021cda053c72d3e8c293606b31e099 100644 (file)
@@ -1303,8 +1303,9 @@ static int bfin5xx_spi_resume(struct platform_device *pdev)
 #define bfin5xx_spi_resume NULL
 #endif                         /* CONFIG_PM */
 
+MODULE_ALIAS("bfin-spi-master");       /* for platform bus hotplug */
 static struct platform_driver bfin5xx_spi_driver = {
-       .driver         = {
+       .driver = {
                .name   = "bfin-spi-master",
                .owner  = THIS_MODULE,
        },
index aee9ad6f633ca14e2619c78e0d36dd82df4ba34f..bd9177f51de9d347062e2493d4d7fd1d963ce0d6 100644 (file)
@@ -1735,7 +1735,7 @@ static int spi_imx_resume(struct platform_device *pdev)
 
 static struct platform_driver driver = {
        .driver = {
-               .name = "imx-spi",
+               .name = "spi_imx",
                .bus = &platform_bus_type,
                .owner = THIS_MODULE,
        },
index 2adf856e44c2bf0d91d6081adfc25b9549559384..fcbf1b8a5264dfec0e4e8f74b6101f5440ea8ea6 100644 (file)
@@ -530,6 +530,7 @@ static int __devexit mpc83xx_spi_remove(struct platform_device *dev)
        return 0;
 }
 
+MODULE_ALIAS("mpc83xx_spi");                   /* for platform bus hotplug */
 static struct platform_driver mpc83xx_spi_driver = {
        .probe = mpc83xx_spi_probe,
        .remove = __devexit_p(mpc83xx_spi_remove),
index 5cf48123e0efbb42612d3c94e59b730b6c00ee79..e9b683f7d7b3bc7f77d0e3e55b611cf09b0f96ea 100644 (file)
@@ -427,6 +427,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
 #define s3c24xx_spi_resume  NULL
 #endif
 
+MODULE_ALIAS("s3c2410_spi");                   /* for platform bus hotplug */
 static struct platform_driver s3c24xx_spidrv = {
        .probe          = s3c24xx_spi_probe,
        .remove         = s3c24xx_spi_remove,
index 611ac22b7cdc2c404e69c07d8dfbcd4e73b1db7c..0fa25e2e80fe556cbde8b1e01843f452129dfaea 100644 (file)
@@ -180,7 +180,7 @@ static struct platform_driver s3c2410_spigpio_drv = {
         .suspend       = s3c2410_spigpio_suspend,
         .resume                = s3c2410_spigpio_resume,
         .driver                = {
-               .name   = "s3c24xx-spi-gpio",
+               .name   = "spi_s3c24xx_gpio",
                .owner  = THIS_MODULE,
         },
 };
index 08e981c40646810dd5de12ae1d03026b636374cb..f6c3677035b0a65378f065192bae3fd3ff4adf7e 100644 (file)
@@ -450,6 +450,7 @@ static int __exit txx9spi_remove(struct platform_device *dev)
        return 0;
 }
 
+MODULE_ALIAS("txx9spi");                       /* for platform bus hotplug */
 static struct platform_driver txx9spi_driver = {
        .remove = __exit_p(txx9spi_remove),
        .driver = {
index f0bf9a68e96bf03424c65a891e91f4e1322b81b2..5d04f520c12323067e810047afe0aa0e740d1851 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <syslib/virtex_devices.h>
 
-#define XILINX_SPI_NAME "xspi"
+#define XILINX_SPI_NAME "xilinx_spi"
 
 /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
  * Product Specification", DS464