Skip to contentSkip to conversation

i2c-powermac: Silence modalias failure message on G5 powermacs

PATCH New Daniel Palmer 1 participant 1 message Oct 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c-powermac: Silence modalias failure message on G5 powermacs

G5 powermacs, and maybe others, have i2c nodes that have no compatible and cause i2c_powermac_get_type() to print a warning like:

i2c i2c-3: i2c-powermac: modalias failure on /u3@0,f8000000/i2c@f8001000/cereal@1c0

The point of i2c_powermac_get_type() seems to be to override the modalias that comes from the compatible so that normal i2c device drivers do not bind to devices that are managed by other mac specific drivers (like the fan control ones).

Since a device with no compatible shouldn't bind to any normal device the warning doesn't need to be printed.

---
 drivers/i2c/busses/i2c-powermac.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/i2c/busses/i2c-powermac.c +12 -0
index f99a2cc721a8..b37cf5b4ab10 100644
@@ -299,6 +299,18 @@ static bool i2c_powermac_get_type(struct i2c_adapter *adap,
 		}
 	}
 
+	/*
+	 * Some Apple device trees have i2c nodes with no compatible that can be
+	 * ignored. Without this the cereal node on G5 macs prints the modalias
+	 * warning below on every boot.
+	 */
+	if (!of_property_present(node, "compatible")) {
+		dev_dbg(&adap->dev,
+			"i2c-powermac: no compatible property on %pOF, skipping\n",
+			node);
+		return false;
+	}
+
 	dev_err(&adap->dev, "i2c-powermac: modalias failure on %pOF\n", node);
 	return false;
 }
Signature · 1 line
2.55.0