firmware: arm_ffa: Set the core device as FF-A device parent

Pass a parent device into ffa_device_register() and use the synthetic
arm-ffa platform device as the parent for each registered FF-A device.

This keeps the enumerated FF-A partition devices anchored below the FF-A
core device in the driver model, matching the platform-driver conversion
of the core transport.

Suggested-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Link: https://patch.msgid.link/20260508-b4-ffa_plat_dev-v1-3-c5a30f8cf7b8@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
This commit is contained in:
Sudeep Holla 2026-05-08 18:54:17 +01:00
parent e659fc8e53
commit 7fe2ec9fb8
3 changed files with 7 additions and 5 deletions

View File

@ -192,7 +192,7 @@ bool ffa_device_is_valid(struct ffa_device *ffa_dev)
struct ffa_device *
ffa_device_register(const struct ffa_partition_info *part_info,
const struct ffa_ops *ops)
const struct ffa_ops *ops, struct device *parent)
{
int id, ret;
struct device *dev;
@ -212,6 +212,7 @@ ffa_device_register(const struct ffa_partition_info *part_info,
}
dev = &ffa_dev->dev;
dev->parent = parent;
dev->bus = &ffa_bus_type;
dev->release = ffa_release_device;
dev->dma_mask = &dev->coherent_dma_mask;

View File

@ -1738,7 +1738,7 @@ static int ffa_setup_host_partition(int vm_id)
int ret;
buf.id = vm_id;
ffa_dev = ffa_device_register(&buf, &ffa_drv_ops);
ffa_dev = ffa_device_register(&buf, &ffa_drv_ops, &ffa_pdev->dev);
if (!ffa_dev) {
pr_err("%s: failed to register host partition ID 0x%x\n",
__func__, vm_id);
@ -1813,7 +1813,8 @@ static int ffa_setup_partitions(void)
* provides UUID here for each partition as part of the
* discovery API and the same is passed.
*/
ffa_dev = ffa_device_register(tpbuf, &ffa_drv_ops);
ffa_dev = ffa_device_register(tpbuf, &ffa_drv_ops,
&ffa_pdev->dev);
if (!ffa_dev) {
pr_err("%s: failed to register partition ID 0x%x\n",
__func__, tpbuf->id);

View File

@ -173,7 +173,7 @@ struct ffa_partition_info;
#if IS_REACHABLE(CONFIG_ARM_FFA_TRANSPORT)
struct ffa_device *
ffa_device_register(const struct ffa_partition_info *part_info,
const struct ffa_ops *ops);
const struct ffa_ops *ops, struct device *parent);
void ffa_device_unregister(struct ffa_device *ffa_dev);
int ffa_driver_register(struct ffa_driver *driver, struct module *owner,
const char *mod_name);
@ -184,7 +184,7 @@ bool ffa_device_is_valid(struct ffa_device *ffa_dev);
#else
static inline struct ffa_device *
ffa_device_register(const struct ffa_partition_info *part_info,
const struct ffa_ops *ops)
const struct ffa_ops *ops, struct device *parent)
{
return NULL;
}