aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-s3c2410.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-s3c2410.c')
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 007390ad9810..eef35d3f6073 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -752,9 +752,12 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c)
752static int s3c24xx_i2c_probe(struct platform_device *pdev) 752static int s3c24xx_i2c_probe(struct platform_device *pdev)
753{ 753{
754 struct s3c24xx_i2c *i2c = &s3c24xx_i2c; 754 struct s3c24xx_i2c *i2c = &s3c24xx_i2c;
755 struct s3c2410_platform_i2c *pdata;
755 struct resource *res; 756 struct resource *res;
756 int ret; 757 int ret;
757 758
759 pdata = s3c24xx_i2c_get_platformdata(&pdev->dev);
760
758 /* find the clock and enable it */ 761 /* find the clock and enable it */
759 762
760 i2c->dev = &pdev->dev; 763 i2c->dev = &pdev->dev;
@@ -832,7 +835,15 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
832 dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res, 835 dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res,
833 (unsigned long)res->start); 836 (unsigned long)res->start);
834 837
835 ret = i2c_add_adapter(&i2c->adap); 838 /* Note, previous versions of the driver used i2c_add_adapter()
839 * to add the bus at any number. We now pass the bus number via
840 * the platform data, so if unset it will now default to always
841 * being bus 0.
842 */
843
844 i2c->adap.nr = pdata->bus_num;
845
846 ret = i2c_add_numbered_adapter(&i2c->adap);
836 if (ret < 0) { 847 if (ret < 0) {
837 dev_err(&pdev->dev, "failed to add bus to i2c core\n"); 848 dev_err(&pdev->dev, "failed to add bus to i2c core\n");
838 goto err_irq; 849 goto err_irq;