Skip to content

Commit d582963

Browse files
Jean DelvareJean Delvare
authored andcommitted
i2c: Simplify i2c_parent_is_i2c_adapter
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>
1 parent 3235844 commit d582963

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

‎include/linux/i2c.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
387387
static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
388388
{
389389
return adapter->dev.parent != NULL
390-
&& adapter->dev.parent->bus == &i2c_bus_type
391390
&& adapter->dev.parent->type == &i2c_adapter_type;
392391
}
393392

0 commit comments

Comments
 (0)