Only i2c devices can have their type set to i2c_adapter_type, so
testing the bus type is redundant.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Michael Lawnick <ml.lawnick@gmx.de>
static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
{
return adapter->dev.parent != NULL
static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
{
return adapter->dev.parent != NULL
- && adapter->dev.parent->bus == &i2c_bus_type
&& adapter->dev.parent->type == &i2c_adapter_type;
}
&& adapter->dev.parent->type == &i2c_adapter_type;
}