Thread (27 messages) 27 messages, 9 authors, 2026-02-23

Re: [PATCH 1/8] of: provide of_machine_get_compatible()

From: Bartosz Golaszewski <brgl@kernel.org>
Date: 2026-01-19 13:00:48
Also in: imx, linux-arm-kernel, linux-devicetree, linux-renesas-soc, linux-sunxi, lkml

On Mon, Jan 19, 2026 at 12:26 PM Danilo Krummrich [off-list ref] wrote:
On Mon Jan 19, 2026 at 11:40 AM CET, Bartosz Golaszewski wrote:
quoted
+/**
+ * of_machine_get_compatible - Get the compatible string of this machine
+ * @compatible: address at which the compatible string will be stored
+ *
+ * Returns:
+ * 0 on success, negative error number on failure.
+ */
+int of_machine_get_compatible(const char **compatible)
I think the name of this function is not ideal. 'get' usually indicates that a
reference count will be taken, but this is not the case here.

I'm also not sure about the machine prefix. If we really want this helper I'd
suggest something along the lines of e.g. of_root_read_compatible().
Makes sense for the "read" part but I'm not sure about the "root" bit.
We already have a whole set of "of_machine_" interfaces, like
of_machine_is_compatible().

How about of_machine_read_compatible()?

Bartosz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help