Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jean Delvare and committed by
Jean Delvare
d582963a 32358443

-1
-1
include/linux/i2c.h
··· 387 387 static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 388 388 { 389 389 return adapter->dev.parent != NULL 390 - && adapter->dev.parent->bus == &i2c_bus_type 391 390 && adapter->dev.parent->type == &i2c_adapter_type; 392 391 } 393 392