diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2014-02-10 11:03:56 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-03-05 17:16:45 +0100 |
commit | 0c176170089c3a7f2a891f9860f5cdc5f481ff78 (patch) | |
tree | b86e44370013676481e49c57c7e46d65190d9203 /drivers/i2c | |
parent | 624df09f3a20b7073289d7f7d8672734ca1339a9 (diff) | |
download | linux-0c176170089c3a7f2a891f9860f5cdc5f481ff78.tar.gz linux-0c176170089c3a7f2a891f9860f5cdc5f481ff78.tar.bz2 linux-0c176170089c3a7f2a891f9860f5cdc5f481ff78.zip |
i2c: add deprecation warning for class based instantiation
Class based instantiation can cause noticeable delays when booting. This
mechanism is used when it is not possible to describe slaves on I2C
busses. As we do have other mechanisms, most embedded I2C will not need
classes and for embedded it is explicitly not recommended to use them. Add
a deprecation warning for drivers which want to disable class based
instantiation in the near future to gain boot-up time, so users relying
on this technique can switch to something better. They really should.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 5fb80b8962a2..98a5fd950f16 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1941,6 +1941,13 @@ static int i2c_detect_address(struct i2c_client *temp_client, struct i2c_client *client; /* Detection succeeded, instantiate the device */ + if (adapter->class & I2C_CLASS_DEPRECATED) + dev_warn(&adapter->dev, + "This adapter will soon drop class based instantiation of devices. " + "Please make sure client 0x%02x gets instantiated by other means. " + "Check 'Documentation/i2c/instantiating-devices' for details.\n", + info.addr); + dev_dbg(&adapter->dev, "Creating %s at 0x%02x\n", info.type, info.addr); client = i2c_new_device(adapter, &info); |