[PATCH 3/3] firmware: arm_ffa: Provide .dma_configure()

From: Viresh Kumar
Date: Tue Jan 21 2025 - 02:07:56 EST


Provide .dma_configure() callback to make reserved-memory work for FFA
devices.

Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
---
drivers/firmware/arm_ffa/bus.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c
index ca526e438e71..e7fd25ba71a4 100644
--- a/drivers/firmware/arm_ffa/bus.c
+++ b/drivers/firmware/arm_ffa/bus.c
@@ -110,12 +110,21 @@ static struct attribute *ffa_device_attributes_attrs[] = {
};
ATTRIBUTE_GROUPS(ffa_device_attributes);

+static int ffa_Device_dma_configure(struct device *dev)
+{
+ if (dev->of_node)
+ return of_dma_configure(dev, dev->of_node, true);
+
+ return 0;
+}
+
const struct bus_type ffa_bus_type = {
.name = "arm_ffa",
.match = ffa_device_match,
.probe = ffa_device_probe,
.remove = ffa_device_remove,
.uevent = ffa_device_uevent,
+ .dma_configure = ffa_Device_dma_configure,
.dev_groups = ffa_device_attributes_groups,
};
EXPORT_SYMBOL_GPL(ffa_bus_type);
--
2.31.1.272.g89b43f80a514