aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-davinci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi-davinci.c')
-rw-r--r--drivers/spi/spi-davinci.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 5e7389faa2a0..50f750989258 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -802,8 +802,7 @@ static int spi_davinci_get_pdata(struct platform_device *pdev,
802 pdata = &dspi->pdata; 802 pdata = &dspi->pdata;
803 803
804 pdata->version = SPI_VERSION_1; 804 pdata->version = SPI_VERSION_1;
805 match = of_match_device(of_match_ptr(davinci_spi_of_match), 805 match = of_match_device(davinci_spi_of_match, &pdev->dev);
806 &pdev->dev);
807 if (!match) 806 if (!match)
808 return -ENODEV; 807 return -ENODEV;
809 808
@@ -824,7 +823,6 @@ static int spi_davinci_get_pdata(struct platform_device *pdev,
824 return 0; 823 return 0;
825} 824}
826#else 825#else
827#define davinci_spi_of_match NULL
828static struct davinci_spi_platform_data 826static struct davinci_spi_platform_data
829 *spi_davinci_get_pdata(struct platform_device *pdev, 827 *spi_davinci_get_pdata(struct platform_device *pdev,
830 struct davinci_spi *dspi) 828 struct davinci_spi *dspi)
@@ -864,10 +862,6 @@ static int davinci_spi_probe(struct platform_device *pdev)
864 platform_set_drvdata(pdev, master); 862 platform_set_drvdata(pdev, master);
865 863
866 dspi = spi_master_get_devdata(master); 864 dspi = spi_master_get_devdata(master);
867 if (dspi == NULL) {
868 ret = -ENOENT;
869 goto free_master;
870 }
871 865
872 if (dev_get_platdata(&pdev->dev)) { 866 if (dev_get_platdata(&pdev->dev)) {
873 pdata = dev_get_platdata(&pdev->dev); 867 pdata = dev_get_platdata(&pdev->dev);
@@ -908,10 +902,6 @@ static int davinci_spi_probe(struct platform_device *pdev)
908 goto free_master; 902 goto free_master;
909 903
910 dspi->bitbang.master = master; 904 dspi->bitbang.master = master;
911 if (dspi->bitbang.master == NULL) {
912 ret = -ENODEV;
913 goto free_master;
914 }
915 905
916 dspi->clk = devm_clk_get(&pdev->dev, NULL); 906 dspi->clk = devm_clk_get(&pdev->dev, NULL);
917 if (IS_ERR(dspi->clk)) { 907 if (IS_ERR(dspi->clk)) {
@@ -1040,7 +1030,7 @@ static struct platform_driver davinci_spi_driver = {
1040 .driver = { 1030 .driver = {
1041 .name = "spi_davinci", 1031 .name = "spi_davinci",
1042 .owner = THIS_MODULE, 1032 .owner = THIS_MODULE,
1043 .of_match_table = davinci_spi_of_match, 1033 .of_match_table = of_match_ptr(davinci_spi_of_match),
1044 }, 1034 },
1045 .probe = davinci_spi_probe, 1035 .probe = davinci_spi_probe,
1046 .remove = davinci_spi_remove, 1036 .remove = davinci_spi_remove,