diff options
author | Karol Lewandowski <k.lewandowsk@samsung.com> | 2012-03-27 09:10:28 (GMT) |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-05-12 12:28:11 (GMT) |
commit | 44454baa7ca7bb57c47a5564ed2528ba211fe8db (patch) | |
tree | 590ed2e391c6fdaac6b4add9c36f502371796ede /drivers/i2c/busses/i2c-versatile.c | |
parent | bc414b7b9bbccbdeac80757c03a966578d04a9a2 (diff) | |
download | linux-44454baa7ca7bb57c47a5564ed2528ba211fe8db.tar.xz |
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-versatile.c')
-rw-r--r-- | drivers/i2c/busses/i2c-versatile.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c index f585aea..eec20db 100644 --- a/drivers/i2c/busses/i2c-versatile.c +++ b/drivers/i2c/busses/i2c-versatile.c @@ -104,13 +104,8 @@ static int i2c_versatile_probe(struct platform_device *dev) i2c->algo = i2c_versatile_algo; i2c->algo.data = i2c; - if (dev->id >= 0) { - /* static bus numbering */ - i2c->adap.nr = dev->id; - ret = i2c_bit_add_numbered_bus(&i2c->adap); - } else - /* dynamic bus numbering */ - ret = i2c_bit_add_bus(&i2c->adap); + i2c->adap.nr = dev->id; + ret = i2c_bit_add_numbered_bus(&i2c->adap); if (ret >= 0) { platform_set_drvdata(dev, i2c); of_i2c_register_devices(&i2c->adap); |