spi: spi_s3c24xx driver must init completion
[sfrench/cifs-2.6.git] / drivers / spi / spi_s3c24xx.c
index 89d6685a5ca4860594773a346e37dbad40021762..6f2c79da984dc01bb7b359f5ffb5a6a98ef5b7b0 100644 (file)
@@ -192,8 +192,11 @@ static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
        hw->len = t->len;
        hw->count = 0;
 
+       init_completion(&hw->done);
+
        /* send the first byte */
        writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
+
        wait_for_completion(&hw->done);
 
        return hw->count;
@@ -237,10 +240,8 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
 {
        struct s3c24xx_spi *hw;
        struct spi_master *master;
-       struct spi_board_info *bi;
        struct resource *res;
        int err = 0;
-       int i;
 
        master = spi_alloc_master(&pdev->dev, sizeof(struct s3c24xx_spi));
        if (master == NULL) {
@@ -348,16 +349,6 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
                goto err_register;
        }
 
-       /* register all the devices associated */
-
-       bi = &hw->pdata->board_info[0];
-       for (i = 0; i < hw->pdata->board_size; i++, bi++) {
-               dev_info(hw->dev, "registering %s\n", bi->modalias);
-
-               bi->controller_data = hw;
-               spi_new_device(master, bi);
-       }
-
        return 0;
 
  err_register:
@@ -427,7 +418,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
 #define s3c24xx_spi_resume  NULL
 #endif
 
-MODULE_ALIAS("s3c2410_spi");                   /* for platform bus hotplug */
+MODULE_ALIAS("platform:s3c2410-spi");
 static struct platform_driver s3c24xx_spidrv = {
        .remove         = __exit_p(s3c24xx_spi_remove),
        .suspend        = s3c24xx_spi_suspend,