]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i2c: style cleanups after idr_alloc() conversion
authorTejun Heo <tj@kernel.org>
Wed, 20 Feb 2013 02:16:16 +0000 (13:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:53:47 +0000 (16:53 +1100)
Style cleanups suggested by Wolfram.

* s/res/id/ in i2c_add_numbered_adapter() so that it matches
  i2c_add_adapter().

* Add a blank line before return in i2c_add_numbered_adapter().

This patch is purely cosmetic.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Wolfram Sang <wolfram@the-dreams.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/i2c/i2c-core.c

index 0b599f25c17de6ea33250307d40da1489a3cb3c1..8d1f644a7fdc55bae4cfef394f6e06a8cbd8d9b6 100644 (file)
@@ -935,16 +935,17 @@ out_list:
  */
 int i2c_add_adapter(struct i2c_adapter *adapter)
 {
-       int res;
+       int id;
 
        mutex_lock(&core_lock);
-       res = idr_alloc(&i2c_adapter_idr, adapter,
-                       __i2c_first_dynamic_bus_num, 0, GFP_KERNEL);
+       id = idr_alloc(&i2c_adapter_idr, adapter,
+                      __i2c_first_dynamic_bus_num, 0, GFP_KERNEL);
        mutex_unlock(&core_lock);
-       if (res < 0)
-               return res;
+       if (id < 0)
+               return id;
+
+       adapter->nr = id;
 
-       adapter->nr = res;
        return i2c_register_adapter(adapter);
 }
 EXPORT_SYMBOL(i2c_add_adapter);