DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] bus/platform: probe devices without resources
@ 2023-03-13  7:07 Tomasz Duszynski
  2023-03-16 16:49 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Duszynski @ 2023-03-13  7:07 UTC (permalink / raw)
  To: dev, Tomasz Duszynski; +Cc: jerinj, thomas

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.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
 drivers/bus/platform/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/platform/platform.c b/drivers/bus/platform/platform.c
index 536d9524c6..8a73f4d7e1 100644
--- a/drivers/bus/platform/platform.c
+++ b/drivers/bus/platform/platform.c
@@ -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)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bus/platform: probe devices without resources
  2023-03-13  7:07 [PATCH] bus/platform: probe devices without resources Tomasz Duszynski
@ 2023-03-16 16:49 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2023-03-16 16:49 UTC (permalink / raw)
  To: Tomasz Duszynski; +Cc: dev, jerinj

13/03/2023 08:07, Tomasz Duszynski:
> 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.
> 
> Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>

Applied, thanks.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-16 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13  7:07 [PATCH] bus/platform: probe devices without resources Tomasz Duszynski
2023-03-16 16:49 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).