Skip to contentSkip to conversation

bus/platform: probe devices without resources

PATCH Applied Tomasz Duszynski 2 participants 2 messages Mar 13, 2023 – Mar 16, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus/platform: probe devices without resources

Platform device does not necessarily need to have any resources defined. That means device is only capable of doing DMA transfers and platform bus should not hinder a valid use-case.

---
 drivers/bus/platform/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/platform/platform.c +3 -1
index 536d9524c6..8a73f4d7e1 100644
@@ -269,8 +269,10 @@ device_map_resources(struct rte_platform_device *pdev, unsigned int num)
 	unsigned int i;
 	int ret;
 
-	if (num == 0)
+	if (num == 0) {
 		PLATFORM_LOG(WARNING, "device %s has no resources\n", pdev->name);
+		return 0;
+	}
 
 	pdev->resource = calloc(num, sizeof(*pdev->resource));
 	if (pdev->resource == NULL)
Signature · 1 line
2.34.1
#1 lore raw

13/03/2023 08:07, Tomasz Duszynski:

Quoted 5 lines

Platform device does not necessarily need to have any resources defined. That means device is only capable of doing DMA transfers and platform bus should not hinder a valid use-case.

Applied, thanks.