diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-mpc.c')
-rw-r--r-- | drivers/i2c/busses/i2c-mpc.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index b74e6dc6886c..107397a606b4 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -560,15 +560,20 @@ static struct i2c_adapter mpc_ops = { | |||
560 | .timeout = HZ, | 560 | .timeout = HZ, |
561 | }; | 561 | }; |
562 | 562 | ||
563 | static int __devinit fsl_i2c_probe(struct platform_device *op, | 563 | static const struct of_device_id mpc_i2c_of_match[]; |
564 | const struct of_device_id *match) | 564 | static int __devinit fsl_i2c_probe(struct platform_device *op) |
565 | { | 565 | { |
566 | const struct of_device_id *match; | ||
566 | struct mpc_i2c *i2c; | 567 | struct mpc_i2c *i2c; |
567 | const u32 *prop; | 568 | const u32 *prop; |
568 | u32 clock = MPC_I2C_CLOCK_LEGACY; | 569 | u32 clock = MPC_I2C_CLOCK_LEGACY; |
569 | int result = 0; | 570 | int result = 0; |
570 | int plen; | 571 | int plen; |
571 | 572 | ||
573 | match = of_match_device(mpc_i2c_of_match, &op->dev); | ||
574 | if (!match) | ||
575 | return -EINVAL; | ||
576 | |||
572 | i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); | 577 | i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); |
573 | if (!i2c) | 578 | if (!i2c) |
574 | return -ENOMEM; | 579 | return -ENOMEM; |
@@ -700,7 +705,7 @@ static const struct of_device_id mpc_i2c_of_match[] = { | |||
700 | MODULE_DEVICE_TABLE(of, mpc_i2c_of_match); | 705 | MODULE_DEVICE_TABLE(of, mpc_i2c_of_match); |
701 | 706 | ||
702 | /* Structure for a device driver */ | 707 | /* Structure for a device driver */ |
703 | static struct of_platform_driver mpc_i2c_driver = { | 708 | static struct platform_driver mpc_i2c_driver = { |
704 | .probe = fsl_i2c_probe, | 709 | .probe = fsl_i2c_probe, |
705 | .remove = __devexit_p(fsl_i2c_remove), | 710 | .remove = __devexit_p(fsl_i2c_remove), |
706 | .driver = { | 711 | .driver = { |
@@ -712,18 +717,12 @@ static struct of_platform_driver mpc_i2c_driver = { | |||
712 | 717 | ||
713 | static int __init fsl_i2c_init(void) | 718 | static int __init fsl_i2c_init(void) |
714 | { | 719 | { |
715 | int rv; | 720 | 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 | } | 721 | } |
723 | 722 | ||
724 | static void __exit fsl_i2c_exit(void) | 723 | static void __exit fsl_i2c_exit(void) |
725 | { | 724 | { |
726 | of_unregister_platform_driver(&mpc_i2c_driver); | 725 | platform_driver_unregister(&mpc_i2c_driver); |
727 | } | 726 | } |
728 | 727 | ||
729 | module_init(fsl_i2c_init); | 728 | module_init(fsl_i2c_init); |