summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device/smbus_ops.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/device/smbus_ops.c b/src/device/smbus_ops.c
index 184a06ad6c..f4b1355d28 100644
--- a/src/device/smbus_ops.c
+++ b/src/device/smbus_ops.c
@@ -29,8 +29,17 @@ struct bus *get_pbus_smbus(device_t dev)
{
struct bus *pbus = dev->bus;
- while (pbus && pbus->dev && !ops_smbus_bus(pbus))
- pbus = pbus->dev->bus;
+ while (pbus && pbus->dev && !ops_smbus_bus(pbus)) {
+ if (pbus->dev->bus != pbus) {
+ pbus = pbus->dev->bus;
+ }
+ else {
+ printk(BIOS_WARNING,
+ "%s Find SMBus bus operations: unable to proceed\n",
+ dev_path(dev));
+ break;
+ }
+ }
if (!pbus || !pbus->dev || !pbus->dev->ops
|| !pbus->dev->ops->ops_smbus_bus) {