From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH] pci: do not mark device as taken when probe fails Date: Mon, 7 Nov 2016 10:03:29 +0100 Message-ID: <1478509409-25508-1-git-send-email-david.marchand@6wind.com> References: Cc: dev@dpdk.org, benjamin.walker@intel.com To: thomas.monjalon@6wind.com Return-path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 0AEA05591 for ; Mon, 7 Nov 2016 10:03:37 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id f82so104443290wmf.1 for ; Mon, 07 Nov 2016 01:03:37 -0800 (PST) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" dev->driver should be set only if a driver did take the device. Signed-off-by: David Marchand --- lib/librte_eal/common/eal_common_pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 971ad20..6163b09 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -214,7 +214,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d dev->driver = dr; /* call the driver probe() function */ - return dr->probe(dr, dev); + ret = dr->probe(dr, dev); + if (ret) + dev->driver = NULL; + + return ret; } /* return positive value if driver doesn't support this device */ return 1; -- 2.7.4