[PATCH v6 05/23] mailbox: Allow controller specific mapping using fwnode

Andy Shevchenko andriy.shevchenko at linux.intel.com
Mon Jun 23 01:45:05 PDT 2025


On Wed, Jun 18, 2025 at 05:43:40PM +0530, Anup Patel wrote:
> Introduce optional fw_node() callback which allows a mailbox controller
> driver to provide controller specific mapping using fwnode.
> 
> The Linux OF framework already implements fwnode operations for the
> Linux DD framework so the fw_xlate() callback works fine with device
> tree as well.

...

> +	fwnode = dev_fwnode(dev);
> +	if (!fwnode) {
> +		dev_dbg(dev, "No owner fwnode\n");
> +		return ERR_PTR(-ENODEV);
> +	}
> +
> +	ret = fwnode_property_get_reference_args(dev_fwnode(dev), "mboxes",

Why not using fwnode directly here?

> +						 "#mbox-cells", 0, index, &fwspec);
>  	if (ret) {
> -		dev_err(dev, "%s: can't parse \"mboxes\" property\n", __func__);
> +		dev_err(dev, "%s: can't parse \"%s\" property\n", __func__, "mboxes");
>  		return ERR_PTR(ret);
>  	}

...

Otherwise looks like a good solution to get rid of OF-centric code from mailbox
in the future.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-riscv mailing list