From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8861A41E83; Mon, 13 Mar 2023 08:07:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B20D406BC; Mon, 13 Mar 2023 08:07:45 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 46CC040151 for ; Mon, 13 Mar 2023 08:07:43 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32D6uQL9013691; Mon, 13 Mar 2023 00:07:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=vahaLKo4f8cDHrZ5SWP12eavbvlyfYQQgqofZCBLWzU=; b=U8Z9Y4tsO+ZqpJIBWTGsVaOcazK/QHk784Q0Yqu7u6Ek5CDYqfY4HOh/YDBHlAgNsvf0 F5+8/0ySUowXr5KkuofOEWKraeXBnbKJ0+7SnJ+cT7md9gHPkgOqVMUnyEHFQWhhqLiz orTxAFFsnytZ3FzkLZuA5EF04z6bZqi9DWFrzWDFx+guxU9Ym4JdT7EA/74rJf5DFcCj felPJ72tCYYA1H2BKINboUhxqxiunQJjMo6kQy950T4b4go1bA6HoWx89pBNioURmZJU obUUT9uxLID93tynQxYI7Wei/Oo35scLU5UTW9bHynwS+bzAuusfZ3tO/uhM+aDSZPiL Jg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3p9xxmr112-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 13 Mar 2023 00:07:42 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 13 Mar 2023 00:07:40 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Mon, 13 Mar 2023 00:07:40 -0700 Received: from cavium-DT10.. (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 068255B693E; Mon, 13 Mar 2023 00:07:37 -0700 (PDT) From: Tomasz Duszynski To: , Tomasz Duszynski CC: , Subject: [PATCH] bus/platform: probe devices without resources Date: Mon, 13 Mar 2023 08:07:35 +0100 Message-ID: <20230313070735.2555186-1-tduszynski@marvell.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: UngHMFPRnQmSGGx6phkwm8BtflyZizHi X-Proofpoint-ORIG-GUID: UngHMFPRnQmSGGx6phkwm8BtflyZizHi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-12_10,2023-03-10_01,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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