diff options
author | Karol Lewandowski <k.lewandowsk@samsung.com> | 2012-03-27 11:10:28 +0200 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-05-12 14:28:11 +0200 |
commit | 44454baa7ca7bb57c47a5564ed2528ba211fe8db (patch) | |
tree | 590ed2e391c6fdaac6b4add9c36f502371796ede /drivers/i2c/busses/i2c-gpio.c | |
parent | bc414b7b9bbccbdeac80757c03a966578d04a9a2 (diff) |
i2c: Dynamically assign adapter id if it wasn't explictly specified
Commit 488bf314b ("i2c: Allow i2c_add_numbered_adapter() to assign a
bus id") reworked i2c_add_numbered_adapter() to call i2c_add_adapter()
if requested bus was -1.
This allows to simplify driver's initialization procedure by using
just one function for static and dynamic adapter id registration.
This patch updates few more drivers (missed out in original patch)
to use this functionality.
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-gpio.c')
-rw-r--r-- | drivers/i2c/busses/i2c-gpio.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index c0330a41db0..e62d2d93862 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -190,12 +190,7 @@ static int __devinit i2c_gpio_probe(struct platform_device *pdev) adap->dev.parent = &pdev->dev; adap->dev.of_node = pdev->dev.of_node; - /* - * If "dev->id" is negative we consider it as zero. - * The reason to do so is to avoid sysfs names that only make - * sense when there are multiple adapters. - */ - adap->nr = (pdev->id != -1) ? pdev->id : 0; + adap->nr = pdev->id; ret = i2c_bit_add_numbered_bus(adap); if (ret) goto err_add_bus; |