From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4 4/9] bus: add bus helper iterator to find a particular device Date: Wed, 21 Jun 2017 14:21:46 +0200 Message-ID: <1984869.kcXMTlSesr@xps> References: <82d275852b7179929081d005e62d458283d7b304.1497999601.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Jan Blunck To: Gaetan Rivet Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 31EB85599 for ; Wed, 21 Jun 2017 14:21:47 +0200 (CEST) In-Reply-To: <82d275852b7179929081d005e62d458283d7b304.1497999601.git.gaetan.rivet@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 21/06/2017 01:29, Gaetan Rivet: > /** > + * Bus iterator to find a particular device. It should be said that it is iterating over every registered buses. > + * > + * If the callback returns non-zero this function will stop iterating over any > + * more buses and devices. To continue a search the device of a previous search > + * is passed via the start parameters. > + * > + * @param start > + * Start device of the iteration. > + * > + * @param cmp > + * Callback function to check device. > + * > + * @param data > + * Data to pass to match callback. > + * > + * @return > + * A pointer to a rte_bus structure or NULL in case no bus matches. > + */ > +struct rte_device * > +rte_bus_find_device(const struct rte_device *start, > + rte_dev_cmp_t cmp, const void *data); The order of the parameters is different of rte_bus_find(): struct rte_bus *rte_bus_find(rte_bus_cmp_t cmp, const void *data, const struct rte_bus *start);