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

Danilo Krummrich dakr at kernel.org
Mon Jan 19 03:26:25 PST 2026


On Mon Jan 19, 2026 at 11:40 AM CET, Bartosz Golaszewski wrote:
> +/**
> + * 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().

> +{
> +	return of_property_read_string(of_root, "compatible", compatible);
> +}
> +EXPORT_SYMBOL_GPL(of_machine_get_compatible);



More information about the linux-arm-kernel mailing list