DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tomasz Duszynski <tduszynski@marvell.com>
To: <dev@dpdk.org>, Tomasz Duszynski <tduszynski@marvell.com>
Cc: <jerinj@marvell.com>, <thomas@monjalon.net>
Subject: [PATCH] bus/platform: probe devices without resources
Date: Mon, 13 Mar 2023 08:07:35 +0100	[thread overview]
Message-ID: <20230313070735.2555186-1-tduszynski@marvell.com> (raw)

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


             reply	other threads:[~2023-03-13  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13  7:07 Tomasz Duszynski [this message]
2023-03-16 16:49 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230313070735.2555186-1-tduszynski@marvell.com \
    --to=tduszynski@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).