Skip to content

Commit

Permalink
i2c: Improve deprecation warnings
Browse files Browse the repository at this point in the history
When warning on the use of deprecated i2c_driver methods
attach_adapter and detach_adapter, mention the name of the driver
which needs to be updated.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Apr 17, 2011
1 parent d733ed6 commit a920ff4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@ static int i2c_do_add_adapter(struct i2c_driver *driver,

/* Let legacy drivers scan this bus for matching devices */
if (driver->attach_adapter) {
dev_warn(&adap->dev, "attach_adapter method is deprecated\n");
dev_warn(&adap->dev, "%s: attach_adapter method is deprecated\n",
driver->driver.name);
dev_warn(&adap->dev, "Please use another way to instantiate "
"your i2c_client\n");
/* We ignore the return code; if it fails, too bad */
Expand Down Expand Up @@ -984,7 +985,8 @@ static int i2c_do_del_adapter(struct i2c_driver *driver,

if (!driver->detach_adapter)
return 0;
dev_warn(&adapter->dev, "detach_adapter method is deprecated\n");
dev_warn(&adapter->dev, "%s: detach_adapter method is deprecated\n",
driver->driver.name);
res = driver->detach_adapter(adapter);
if (res)
dev_err(&adapter->dev, "detach_adapter failed (%d) "
Expand Down

0 comments on commit a920ff4

Please sign in to comment.