Merge tag 'for-v3.8' of git://git.infradead.org/users/cbou/linux-pstore
[cascardo/linux.git] / drivers / spi / spidev.c
index 830adbe..2e0655d 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/mutex.h>
 #include <linux/slab.h>
 #include <linux/compat.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/spidev.h>
@@ -571,7 +573,7 @@ static struct class *spidev_class;
 
 /*-------------------------------------------------------------------------*/
 
-static int __devinit spidev_probe(struct spi_device *spi)
+static int spidev_probe(struct spi_device *spi)
 {
        struct spidev_data      *spidev;
        int                     status;
@@ -620,7 +622,7 @@ static int __devinit spidev_probe(struct spi_device *spi)
        return status;
 }
 
-static int __devexit spidev_remove(struct spi_device *spi)
+static int spidev_remove(struct spi_device *spi)
 {
        struct spidev_data      *spidev = spi_get_drvdata(spi);
 
@@ -642,13 +644,21 @@ static int __devexit spidev_remove(struct spi_device *spi)
        return 0;
 }
 
+static const struct of_device_id spidev_dt_ids[] = {
+       { .compatible = "rohm,dh2228fv" },
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, spidev_dt_ids);
+
 static struct spi_driver spidev_spi_driver = {
        .driver = {
                .name =         "spidev",
                .owner =        THIS_MODULE,
+               .of_match_table = of_match_ptr(spidev_dt_ids),
        },
        .probe =        spidev_probe,
-       .remove =       __devexit_p(spidev_remove),
+       .remove =       spidev_remove,
 
        /* NOTE:  suspend/resume methods are not necessary here.
         * We don't do anything except pass the requests to/from