Commit 84d0b617 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang

i2c: add error message when obtaining idr fails

Fix some whitespace issues while here.
Signed-off-by: default avatarWolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 8ddfe410
...@@ -1684,13 +1684,12 @@ static int i2c_register_adapter(struct i2c_adapter *adap) ...@@ -1684,13 +1684,12 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
*/ */
static int __i2c_add_numbered_adapter(struct i2c_adapter *adap) static int __i2c_add_numbered_adapter(struct i2c_adapter *adap)
{ {
int id; int id;
mutex_lock(&core_lock); mutex_lock(&core_lock);
id = idr_alloc(&i2c_adapter_idr, adap, adap->nr, adap->nr + 1, id = idr_alloc(&i2c_adapter_idr, adap, adap->nr, adap->nr + 1, GFP_KERNEL);
GFP_KERNEL);
mutex_unlock(&core_lock); mutex_unlock(&core_lock);
if (id < 0) if (WARN(id < 0, "couldn't get idr"))
return id == -ENOSPC ? -EBUSY : id; return id == -ENOSPC ? -EBUSY : id;
return i2c_register_adapter(adap); return i2c_register_adapter(adap);
...@@ -1727,7 +1726,7 @@ int i2c_add_adapter(struct i2c_adapter *adapter) ...@@ -1727,7 +1726,7 @@ int i2c_add_adapter(struct i2c_adapter *adapter)
id = idr_alloc(&i2c_adapter_idr, adapter, id = idr_alloc(&i2c_adapter_idr, adapter,
__i2c_first_dynamic_bus_num, 0, GFP_KERNEL); __i2c_first_dynamic_bus_num, 0, GFP_KERNEL);
mutex_unlock(&core_lock); mutex_unlock(&core_lock);
if (id < 0) if (WARN(id < 0, "couldn't get idr"))
return id; return id;
adapter->nr = id; adapter->nr = id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment