diff options
Diffstat (limited to 'drivers/spi/spi_imx.c')
-rw-r--r-- | drivers/spi/spi_imx.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index 55a38e2c6c13..9469564e6888 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c | |||
@@ -66,7 +66,6 @@ enum spi_imx_devtype { | |||
66 | SPI_IMX_VER_0_5, | 66 | SPI_IMX_VER_0_5, |
67 | SPI_IMX_VER_0_7, | 67 | SPI_IMX_VER_0_7, |
68 | SPI_IMX_VER_2_3, | 68 | SPI_IMX_VER_2_3, |
69 | SPI_IMX_VER_AUTODETECT, | ||
70 | }; | 69 | }; |
71 | 70 | ||
72 | struct spi_imx_data; | 71 | struct spi_imx_data; |
@@ -720,9 +719,6 @@ static void spi_imx_cleanup(struct spi_device *spi) | |||
720 | 719 | ||
721 | static struct platform_device_id spi_imx_devtype[] = { | 720 | static struct platform_device_id spi_imx_devtype[] = { |
722 | { | 721 | { |
723 | .name = DRIVER_NAME, | ||
724 | .driver_data = SPI_IMX_VER_AUTODETECT, | ||
725 | }, { | ||
726 | .name = "imx1-cspi", | 722 | .name = "imx1-cspi", |
727 | .driver_data = SPI_IMX_VER_IMX1, | 723 | .driver_data = SPI_IMX_VER_IMX1, |
728 | }, { | 724 | }, { |
@@ -802,30 +798,8 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) | |||
802 | 798 | ||
803 | init_completion(&spi_imx->xfer_done); | 799 | init_completion(&spi_imx->xfer_done); |
804 | 800 | ||
805 | if (pdev->id_entry->driver_data == SPI_IMX_VER_AUTODETECT) { | 801 | spi_imx->devtype_data = |
806 | if (cpu_is_mx25() || cpu_is_mx35()) | 802 | spi_imx_devtype_data[pdev->id_entry->driver_data]; |
807 | spi_imx->devtype_data = | ||
808 | spi_imx_devtype_data[SPI_IMX_VER_0_7]; | ||
809 | else if (cpu_is_mx25() || cpu_is_mx31() || cpu_is_mx35()) | ||
810 | spi_imx->devtype_data = | ||
811 | spi_imx_devtype_data[SPI_IMX_VER_0_4]; | ||
812 | else if (cpu_is_mx27() || cpu_is_mx21()) | ||
813 | spi_imx->devtype_data = | ||
814 | spi_imx_devtype_data[SPI_IMX_VER_0_0]; | ||
815 | else if (cpu_is_mx1()) | ||
816 | spi_imx->devtype_data = | ||
817 | spi_imx_devtype_data[SPI_IMX_VER_IMX1]; | ||
818 | else | ||
819 | BUG(); | ||
820 | } else | ||
821 | spi_imx->devtype_data = | ||
822 | spi_imx_devtype_data[pdev->id_entry->driver_data]; | ||
823 | |||
824 | if (!spi_imx->devtype_data.intctrl) { | ||
825 | dev_err(&pdev->dev, "no support for this device compiled in\n"); | ||
826 | ret = -ENODEV; | ||
827 | goto out_gpio_free; | ||
828 | } | ||
829 | 803 | ||
830 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 804 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
831 | if (!res) { | 805 | if (!res) { |
@@ -847,7 +821,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) | |||
847 | } | 821 | } |
848 | 822 | ||
849 | spi_imx->irq = platform_get_irq(pdev, 0); | 823 | spi_imx->irq = platform_get_irq(pdev, 0); |
850 | if (spi_imx->irq <= 0) { | 824 | if (spi_imx->irq < 0) { |
851 | ret = -EINVAL; | 825 | ret = -EINVAL; |
852 | goto out_iounmap; | 826 | goto out_iounmap; |
853 | } | 827 | } |