diff options
Diffstat (limited to 'drivers/spi/spidev.c')
-rw-r--r-- | drivers/spi/spidev.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 830adbed1d7a..2e0655dbe070 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/compat.h> | 33 | #include <linux/compat.h> |
34 | #include <linux/of.h> | ||
35 | #include <linux/of_device.h> | ||
34 | 36 | ||
35 | #include <linux/spi/spi.h> | 37 | #include <linux/spi/spi.h> |
36 | #include <linux/spi/spidev.h> | 38 | #include <linux/spi/spidev.h> |
@@ -571,7 +573,7 @@ static struct class *spidev_class; | |||
571 | 573 | ||
572 | /*-------------------------------------------------------------------------*/ | 574 | /*-------------------------------------------------------------------------*/ |
573 | 575 | ||
574 | static int __devinit spidev_probe(struct spi_device *spi) | 576 | static int spidev_probe(struct spi_device *spi) |
575 | { | 577 | { |
576 | struct spidev_data *spidev; | 578 | struct spidev_data *spidev; |
577 | int status; | 579 | int status; |
@@ -620,7 +622,7 @@ static int __devinit spidev_probe(struct spi_device *spi) | |||
620 | return status; | 622 | return status; |
621 | } | 623 | } |
622 | 624 | ||
623 | static int __devexit spidev_remove(struct spi_device *spi) | 625 | static int spidev_remove(struct spi_device *spi) |
624 | { | 626 | { |
625 | struct spidev_data *spidev = spi_get_drvdata(spi); | 627 | struct spidev_data *spidev = spi_get_drvdata(spi); |
626 | 628 | ||
@@ -642,13 +644,21 @@ static int __devexit spidev_remove(struct spi_device *spi) | |||
642 | return 0; | 644 | return 0; |
643 | } | 645 | } |
644 | 646 | ||
647 | static const struct of_device_id spidev_dt_ids[] = { | ||
648 | { .compatible = "rohm,dh2228fv" }, | ||
649 | {}, | ||
650 | }; | ||
651 | |||
652 | MODULE_DEVICE_TABLE(of, spidev_dt_ids); | ||
653 | |||
645 | static struct spi_driver spidev_spi_driver = { | 654 | static struct spi_driver spidev_spi_driver = { |
646 | .driver = { | 655 | .driver = { |
647 | .name = "spidev", | 656 | .name = "spidev", |
648 | .owner = THIS_MODULE, | 657 | .owner = THIS_MODULE, |
658 | .of_match_table = of_match_ptr(spidev_dt_ids), | ||
649 | }, | 659 | }, |
650 | .probe = spidev_probe, | 660 | .probe = spidev_probe, |
651 | .remove = __devexit_p(spidev_remove), | 661 | .remove = spidev_remove, |
652 | 662 | ||
653 | /* NOTE: suspend/resume methods are not necessary here. | 663 | /* NOTE: suspend/resume methods are not necessary here. |
654 | * We don't do anything except pass the requests to/from | 664 | * We don't do anything except pass the requests to/from |