From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eCwGK3EbkD6iq/kKPzsy29yi4yU1br8ztGVqbvVBV2c=; b=OVOk2YpFyx0+smYxnyikB2mYEvHbWsihRNiSHcbRkyj6uF46pqY0nJ+ANL1xdFbnXG KRXVMxGocU3rTGM+1Q8bks1UxfwzjxL8wPqIH9z8laPoUay+SvDCBmnJU+YSLAPqQBdc +Kqc3TgBV8ux6sZatD8c74Ii/Z9YaH1eFI0LdZCl0D/nOIDeUuDfaX/nVOYyPWSy6VRo QR66MYEaeFWPrr6KQQqM8PRz8lXAZegnuD+X4gU15Xoigib/RO8hc9ggWD6+QoDlUJxc OGTyX6IAi8MDPhejG+OnrV7kESAI5etJRxPAclfPw39IZ9LlhIAQFo4AmZRvnObUZeLn KYHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eCwGK3EbkD6iq/kKPzsy29yi4yU1br8ztGVqbvVBV2c=; b=KbmaKEKILyUDCir9pwEzV1z8RxRpVWMnRnScI8zfTtWRyym0BkGujq7E9Ek8MExntM WoDVn7nF2cCP8ashcv9/2JUp27vd7O4QGhVwpq1WxY1djSDJJrJDs9WuJUwm823ePO+g GiF22MC4jfXB7LbRe3CXYtvuzNLAVFAJgkBlaSfbpxfkj/z/FVT7lZhFXwoxADiEH2cQ HhPczSURQhn31Vmqzo89YMl+GgRz06x5pyKImv0WMdCZvLdufUMQN5tP0baZz7NLhox3 vXktSF12J0yN2yHUUyGx/hKmDMWpDu+Ng111m4Mg91LM84v+dDYm+iHy3b8hJrGhnYMb j9eA== X-Gm-Message-State: ABUngvekAbzgmsvAZ06K/kRWSxkOxXMPxn1w0fmC+QlfYrV+6ZrSVRP+C9zKOIvKmFk/fOAe X-Received: by 10.194.222.105 with SMTP id ql9mr5475456wjc.63.1478509416818; Mon, 07 Nov 2016 01:03:36 -0800 (PST) Received: from gloops.dev.6wind.com (89.156.119.78.rev.sfr.net. [78.119.156.89]) by smtp.gmail.com with ESMTPSA id w65sm12205523wmd.23.2016.11.07.01.03.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Nov 2016 01:03:36 -0800 (PST) From: David Marchand To: thomas.monjalon@6wind.com Cc: dev@dpdk.org, benjamin.walker@intel.com Date: Mon, 7 Nov 2016 10:03:29 +0100 Message-Id: <1478509409-25508-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH] pci: do not mark device as taken when probe fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 09:03:37 -0000 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