From: David Brownell Date: Fri, 31 Aug 2007 06:56:24 +0000 (-0700) Subject: SPI driver hotplug/coldplug fixes X-Git-Tag: v2.6.23-rc5~25 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc3ba9525b50ea0d1670357ece21ebedcee507ae;p=linux-2.6 SPI driver hotplug/coldplug fixes 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 Cc: Jean Delvare Acked-by: Andrei Konovalov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index 48587c2705..f540ed77a1 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c @@ -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, }, diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index aee9ad6f63..bd9177f51d 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c @@ -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, }, diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 2adf856e44..fcbf1b8a52 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c @@ -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), diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 5cf48123e0..e9b683f7d7 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c @@ -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, diff --git a/drivers/spi/spi_s3c24xx_gpio.c b/drivers/spi/spi_s3c24xx_gpio.c index 611ac22b7c..0fa25e2e80 100644 --- a/drivers/spi/spi_s3c24xx_gpio.c +++ b/drivers/spi/spi_s3c24xx_gpio.c @@ -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, }, }; diff --git a/drivers/spi/spi_txx9.c b/drivers/spi/spi_txx9.c index 08e981c406..f6c3677035 100644 --- a/drivers/spi/spi_txx9.c +++ b/drivers/spi/spi_txx9.c @@ -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 = { diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index f0bf9a68e9..5d04f520c1 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c @@ -21,7 +21,7 @@ #include -#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