aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-mpc.c')
-rw-r--r--drivers/i2c/busses/i2c-mpc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 75b984c519ac..107397a606b4 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -560,15 +560,18 @@ static struct i2c_adapter mpc_ops = {
560 .timeout = HZ, 560 .timeout = HZ,
561}; 561};
562 562
563static const struct of_device_id mpc_i2c_of_match[];
563static int __devinit fsl_i2c_probe(struct platform_device *op) 564static int __devinit fsl_i2c_probe(struct platform_device *op)
564{ 565{
566 const struct of_device_id *match;
565 struct mpc_i2c *i2c; 567 struct mpc_i2c *i2c;
566 const u32 *prop; 568 const u32 *prop;
567 u32 clock = MPC_I2C_CLOCK_LEGACY; 569 u32 clock = MPC_I2C_CLOCK_LEGACY;
568 int result = 0; 570 int result = 0;
569 int plen; 571 int plen;
570 572
571 if (!op->dev.of_match) 573 match = of_match_device(mpc_i2c_of_match, &op->dev);
574 if (!match)
572 return -EINVAL; 575 return -EINVAL;
573 576
574 i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); 577 i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
@@ -605,8 +608,8 @@ static int __devinit fsl_i2c_probe(struct platform_device *op)
605 clock = *prop; 608 clock = *prop;
606 } 609 }
607 610
608 if (op->dev.of_match->data) { 611 if (match->data) {
609 struct mpc_i2c_data *data = op->dev.of_match->data; 612 struct mpc_i2c_data *data = match->data;
610 data->setup(op->dev.of_node, i2c, clock, data->prescaler); 613 data->setup(op->dev.of_node, i2c, clock, data->prescaler);
611 } else { 614 } else {
612 /* Backwards compatibility */ 615 /* Backwards compatibility */