diff options
author | Phil Carmody <phil.carmody@partner.samsung.com> | 2013-06-26 03:56:35 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2013-08-07 10:58:08 -0400 |
commit | 3923172b3d700486c1ca24df9c4c5405a83e2309 (patch) | |
tree | b7f9ec98c0f30b21c7cf08874ae2f2fce2309f66 /include/linux/i2c.h | |
parent | 825642455367e5498da82a8044dd345ac7869c8d (diff) |
i2c: reduce parent checking to a NOOP in non-I2C_MUX case
In 0826374 - i2c: Multiplexed I2C bus core support
core i2c code increased in size and complexity even when I2C_MUX
wasn't selected.
Turning this check into a constant NULL in the n case lets the
client functions in be simplified too, not needing to include
never-called calls to the mux-specific helpers.
Signed-off-by: Phil Carmody <phil.carmody@partner.samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index e988fa935b3c..b3c4b8dac1ce 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -447,11 +447,13 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
447 | static inline struct i2c_adapter * | 447 | static inline struct i2c_adapter * |
448 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) | 448 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) |
449 | { | 449 | { |
450 | #if IS_ENABLED(I2C_MUX) | ||
450 | struct device *parent = adapter->dev.parent; | 451 | struct device *parent = adapter->dev.parent; |
451 | 452 | ||
452 | if (parent != NULL && parent->type == &i2c_adapter_type) | 453 | if (parent != NULL && parent->type == &i2c_adapter_type) |
453 | return to_i2c_adapter(parent); | 454 | return to_i2c_adapter(parent); |
454 | else | 455 | else |
456 | #endif | ||
455 | return NULL; | 457 | return NULL; |
456 | } | 458 | } |
457 | 459 | ||