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.
Signed-off-by: Daniel Palmer <redacted>
---
drivers/i2c/busses/i2c-powermac.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index f99a2cc721a8..b37cf5b4ab10 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -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;
}--
2.55.0