linux-next: manual merge of the driver-core tree with the devicetree tree
From: Mark Brown
Date: Tue Mar 17 2026 - 12:28:58 EST
Hi all,
Today's linux-next merge of the driver-core tree got a conflict in:
drivers/of/base.c
between commit:
82b6c1b542ea0 ("of: Add of_machine_get_match() helper")
from the devicetree tree and commits:
59621105ffca7 ("of: provide of_machine_read_compatible()")
c86d3b7b847cc ("of: provide of_machine_read_model()")
from the driver-core tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/of/base.c
index af048ab88e694,bf4a51887d742..0000000000000
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@@ -434,13 -434,42 +434,41 @@@ bool of_machine_compatible_match(const
}
EXPORT_SYMBOL(of_machine_compatible_match);
+ /**
+ * of_machine_read_compatible - Get the compatible string of this machine
+ * @compatible: address at which the address of the compatible string will be
+ * stored
+ * @index: index of the compatible entry in the list
+ *
+ * Returns:
+ * 0 on success, negative error number on failure.
+ */
+ int of_machine_read_compatible(const char **compatible, unsigned int index)
+ {
+ return of_property_read_string_index(of_root, "compatible", index, compatible);
+ }
+ EXPORT_SYMBOL_GPL(of_machine_read_compatible);
+
+ /**
+ * of_machine_read_model - Get the model string of this machine
+ * @model: address at which the address of the model string will be stored
+ *
+ * Returns:
+ * 0 on success, negative error number on failure.
+ */
+ int of_machine_read_model(const char **model)
+ {
+ return of_property_read_string(of_root, "model", model);
+ }
+ EXPORT_SYMBOL_GPL(of_machine_read_model);
+
/**
- * of_machine_device_match - Test root of device tree against a of_device_id array
+ * of_machine_get_match - Test root of device tree against an of_device_id array
* @matches: NULL terminated array of of_device_id match structures to search in
*
- * Returns true if the root node has any of the given compatible values in its
- * compatible property.
+ * Returns matched entry or NULL
*/
-bool of_machine_device_match(const struct of_device_id *matches)
+const struct of_device_id *of_machine_get_match(const struct of_device_id *matches)
{
struct device_node *root;
const struct of_device_id *match = NULL;
Attachment:
signature.asc
Description: PGP signature