aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 20:28:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 20:28:10 -0400
commit4c5811bf463b0ef82fabbd1708f8bb2d753aeb18 (patch)
treeff37d31217c3804ca05de21a55a9b5ca1ca818b2 /drivers/i2c
parentf74b9444192c60603020c61d7915b72893137edc (diff)
parent9f15444fefdb33509132ff5c9be60cb315c44cb2 (diff)
Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits) tty: serial: altera_jtaguart: Add device tree support tty: serial: altera_uart: Add devicetree support dt: eliminate of_platform_driver shim code dt: Eliminate of_platform_{,un}register_driver dt/serial: Eliminate users of of_platform_{,un}register_driver dt/usb: Eliminate users of of_platform_{,un}register_driver dt/video: Eliminate users of of_platform_{,un}register_driver dt/net: Eliminate users of of_platform_{,un}register_driver dt/sound: Eliminate users of of_platform_{,un}register_driver dt/spi: Eliminate users of of_platform_{,un}register_driver dt: uartlite: merge platform and of_platform driver bindings dt: xilinx_hwicap: merge platform and of_platform driver bindings ipmi: convert OF driver to platform driver leds/leds-gpio: merge platform_driver with of_platform_driver dt/sparc: Eliminate users of of_platform_{,un}register_driver dt/powerpc: Eliminate users of of_platform_{,un}register_driver dt/powerpc: move of_bus_type infrastructure to ibmebus drivercore/dt: add a match table pointer to struct device dt: Typo fix. altera_ps2: Add devicetree support ...
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-cpm.c9
-rw-r--r--drivers/i2c/busses/i2c-ibm_iic.c9
-rw-r--r--drivers/i2c/busses/i2c-mpc.c22
3 files changed, 17 insertions, 23 deletions
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index f2de3be35df3..3a20961bef1e 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -634,8 +634,7 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
634 cpm_muram_free(cpm->i2c_addr); 634 cpm_muram_free(cpm->i2c_addr);
635} 635}
636 636
637static int __devinit cpm_i2c_probe(struct platform_device *ofdev, 637static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
638 const struct of_device_id *match)
639{ 638{
640 int result, len; 639 int result, len;
641 struct cpm_i2c *cpm; 640 struct cpm_i2c *cpm;
@@ -718,7 +717,7 @@ static const struct of_device_id cpm_i2c_match[] = {
718 717
719MODULE_DEVICE_TABLE(of, cpm_i2c_match); 718MODULE_DEVICE_TABLE(of, cpm_i2c_match);
720 719
721static struct of_platform_driver cpm_i2c_driver = { 720static struct platform_driver cpm_i2c_driver = {
722 .probe = cpm_i2c_probe, 721 .probe = cpm_i2c_probe,
723 .remove = __devexit_p(cpm_i2c_remove), 722 .remove = __devexit_p(cpm_i2c_remove),
724 .driver = { 723 .driver = {
@@ -730,12 +729,12 @@ static struct of_platform_driver cpm_i2c_driver = {
730 729
731static int __init cpm_i2c_init(void) 730static int __init cpm_i2c_init(void)
732{ 731{
733 return of_register_platform_driver(&cpm_i2c_driver); 732 return platform_driver_register(&cpm_i2c_driver);
734} 733}
735 734
736static void __exit cpm_i2c_exit(void) 735static void __exit cpm_i2c_exit(void)
737{ 736{
738 of_unregister_platform_driver(&cpm_i2c_driver); 737 platform_driver_unregister(&cpm_i2c_driver);
739} 738}
740 739
741module_init(cpm_i2c_init); 740module_init(cpm_i2c_init);
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 6e3c38240336..e4f88dca99b5 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -691,8 +691,7 @@ static int __devinit iic_request_irq(struct platform_device *ofdev,
691/* 691/*
692 * Register single IIC interface 692 * Register single IIC interface
693 */ 693 */
694static int __devinit iic_probe(struct platform_device *ofdev, 694static int __devinit iic_probe(struct platform_device *ofdev)
695 const struct of_device_id *match)
696{ 695{
697 struct device_node *np = ofdev->dev.of_node; 696 struct device_node *np = ofdev->dev.of_node;
698 struct ibm_iic_private *dev; 697 struct ibm_iic_private *dev;
@@ -806,7 +805,7 @@ static const struct of_device_id ibm_iic_match[] = {
806 {} 805 {}
807}; 806};
808 807
809static struct of_platform_driver ibm_iic_driver = { 808static struct platform_driver ibm_iic_driver = {
810 .driver = { 809 .driver = {
811 .name = "ibm-iic", 810 .name = "ibm-iic",
812 .owner = THIS_MODULE, 811 .owner = THIS_MODULE,
@@ -818,12 +817,12 @@ static struct of_platform_driver ibm_iic_driver = {
818 817
819static int __init iic_init(void) 818static int __init iic_init(void)
820{ 819{
821 return of_register_platform_driver(&ibm_iic_driver); 820 return platform_driver_register(&ibm_iic_driver);
822} 821}
823 822
824static void __exit iic_exit(void) 823static void __exit iic_exit(void)
825{ 824{
826 of_unregister_platform_driver(&ibm_iic_driver); 825 platform_driver_unregister(&ibm_iic_driver);
827} 826}
828 827
829module_init(iic_init); 828module_init(iic_init);
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index b74e6dc6886c..75b984c519ac 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -560,8 +560,7 @@ static struct i2c_adapter mpc_ops = {
560 .timeout = HZ, 560 .timeout = HZ,
561}; 561};
562 562
563static int __devinit fsl_i2c_probe(struct platform_device *op, 563static int __devinit fsl_i2c_probe(struct platform_device *op)
564 const struct of_device_id *match)
565{ 564{
566 struct mpc_i2c *i2c; 565 struct mpc_i2c *i2c;
567 const u32 *prop; 566 const u32 *prop;
@@ -569,6 +568,9 @@ static int __devinit fsl_i2c_probe(struct platform_device *op,
569 int result = 0; 568 int result = 0;
570 int plen; 569 int plen;
571 570
571 if (!op->dev.of_match)
572 return -EINVAL;
573
572 i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); 574 i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
573 if (!i2c) 575 if (!i2c)
574 return -ENOMEM; 576 return -ENOMEM;
@@ -603,8 +605,8 @@ static int __devinit fsl_i2c_probe(struct platform_device *op,
603 clock = *prop; 605 clock = *prop;
604 } 606 }
605 607
606 if (match->data) { 608 if (op->dev.of_match->data) {
607 struct mpc_i2c_data *data = match->data; 609 struct mpc_i2c_data *data = op->dev.of_match->data;
608 data->setup(op->dev.of_node, i2c, clock, data->prescaler); 610 data->setup(op->dev.of_node, i2c, clock, data->prescaler);
609 } else { 611 } else {
610 /* Backwards compatibility */ 612 /* Backwards compatibility */
@@ -700,7 +702,7 @@ static const struct of_device_id mpc_i2c_of_match[] = {
700MODULE_DEVICE_TABLE(of, mpc_i2c_of_match); 702MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
701 703
702/* Structure for a device driver */ 704/* Structure for a device driver */
703static struct of_platform_driver mpc_i2c_driver = { 705static struct platform_driver mpc_i2c_driver = {
704 .probe = fsl_i2c_probe, 706 .probe = fsl_i2c_probe,
705 .remove = __devexit_p(fsl_i2c_remove), 707 .remove = __devexit_p(fsl_i2c_remove),
706 .driver = { 708 .driver = {
@@ -712,18 +714,12 @@ static struct of_platform_driver mpc_i2c_driver = {
712 714
713static int __init fsl_i2c_init(void) 715static int __init fsl_i2c_init(void)
714{ 716{
715 int rv; 717 return platform_driver_register(&mpc_i2c_driver);
716
717 rv = of_register_platform_driver(&mpc_i2c_driver);
718 if (rv)
719 printk(KERN_ERR DRV_NAME
720 " of_register_platform_driver failed (%i)\n", rv);
721 return rv;
722} 718}
723 719
724static void __exit fsl_i2c_exit(void) 720static void __exit fsl_i2c_exit(void)
725{ 721{
726 of_unregister_platform_driver(&mpc_i2c_driver); 722 platform_driver_unregister(&mpc_i2c_driver);
727} 723}
728 724
729module_init(fsl_i2c_init); 725module_init(fsl_i2c_init);