diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2014-07-10 15:46:21 +0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-07-17 00:59:55 +0400 |
commit | 4555227211ae867d8f8ec9eb5182273f58b648c0 (patch) | |
tree | 60b56c084c6a769b697111c4d13415518b33a380 /drivers/i2c/i2c-core.c | |
parent | 5fddf5aac8d9caae67a31bb6e33dc933552a9c7f (diff) | |
download | linux-4555227211ae867d8f8ec9eb5182273f58b648c0.tar.xz |
i2c: add debug info when class instantiation was dropped
We have a warning already when support for old-fashioned class based
instantiation is about to be dropped somewhen soon from a driver. Let's
have another one when it was actually dropped. This allows to remove the
cruft a little earlier and still let users know what happened in the
rare case they are missing devices after the change. However, there is
enough interest to get rid of class based instantiation rather sooner
than later because it improves boot up time.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 4ccff114b147..a1eeb8a5d3f8 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1915,6 +1915,16 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) if (!driver->detect || !address_list) return 0; + /* Warn that the adapter lost class based instantiation */ + if (adapter->class == I2C_CLASS_DEPRECATED) { + dev_dbg(&adapter->dev, + "This adapter dropped support for I2C classes and " + "won't auto-detect %s devices anymore. If you need it, check " + "'Documentation/i2c/instantiating-devices' for alternatives.\n", + driver->driver.name); + return 0; + } + /* Stop here if the classes do not match */ if (!(adapter->class & driver->class)) return 0; |