aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mpc.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/i2c/busses/i2c-mpc.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/i2c/busses/i2c-mpc.c')
-rw-r--r--drivers/i2c/busses/i2c-mpc.c21
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
563static int __devinit fsl_i2c_probe(struct platform_device *op, 563static const struct of_device_id mpc_i2c_of_match[];
564 const struct of_device_id *match) 564static 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[] = {
700MODULE_DEVICE_TABLE(of, mpc_i2c_of_match); 705MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
701 706
702/* Structure for a device driver */ 707/* Structure for a device driver */
703static struct of_platform_driver mpc_i2c_driver = { 708static 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
713static int __init fsl_i2c_init(void) 718static 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
724static void __exit fsl_i2c_exit(void) 723static 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
729module_init(fsl_i2c_init); 728module_init(fsl_i2c_init);