diff options
Diffstat (limited to 'src/device/i2c_bus.c')
-rw-r--r-- | src/device/i2c_bus.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/device/i2c_bus.c b/src/device/i2c_bus.c index 1d4aa2d2b3..41ef14a923 100644 --- a/src/device/i2c_bus.c +++ b/src/device/i2c_bus.c @@ -18,10 +18,10 @@ bool i2c_dev_detect(struct device *dev, unsigned int addr) struct bus *i2c_link(const struct device *const dev) { - if (!dev || !dev->bus) + if (!dev || !dev->upstream) return NULL; - struct bus *link = dev->bus; + struct bus *link = dev->upstream; while (link) { struct device *const parent = link->dev; @@ -29,8 +29,8 @@ struct bus *i2c_link(const struct device *const dev) (parent->ops->ops_i2c_bus || parent->ops->ops_smbus_bus)) break; - if (parent && parent->bus && link != parent->bus) - link = parent->bus; + if (parent && parent->upstream && link != parent->upstream) + link = parent->upstream; else link = NULL; } |