From patchwork Tue Sep 19 21:18:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9960345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62F0C6056A for ; Tue, 19 Sep 2017 21:19:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55C8028EEE for ; Tue, 19 Sep 2017 21:19:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A06528EF8; Tue, 19 Sep 2017 21:19:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E59BF28F00 for ; Tue, 19 Sep 2017 21:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdISVTS (ORCPT ); Tue, 19 Sep 2017 17:19:18 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:45999 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbdISVTR (ORCPT ); Tue, 19 Sep 2017 17:19:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=hQznn0DwagZFi5TPuCjvA4JjSa1Tth0LZVWxA6/yrIE=; b=TD9JnBgE9Y40gmIYDFtv7BJXnIfBRGHQsuzHAxAgipTUnG3mQTGdqlj6WhdCjiaAgA5ilaWnA0N3p9EZ6pw3eZ+paXh/dTMMdrAt4sDfO+vKM0m3bV2RV6TK/x04SVU+VuPBEOf7CF8iIGsVUORAqro4EUvgUw6/lyjFeYIzzVs=; Received: from [10.0.0.156] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1duPvI-0000On-WD; Tue, 19 Sep 2017 15:19:17 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Yishai Hadas Subject: [PATCH rdma-core 05/10] verbs: Remove the init_device entry point Date: Tue, 19 Sep 2017 15:18:46 -0600 Message-Id: <1505855931-4956-6-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505855931-4956-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1505855931-4956-1-git-send-email-jgunthorpe@obsidianresearch.com> X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.156 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All providers are converted now. Signed-off-by: Jason Gunthorpe --- libibverbs/driver.h | 2 -- libibverbs/init.c | 22 +++++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/libibverbs/driver.h b/libibverbs/driver.h index 397441f49a0e5a..168728cfa1a524 100644 --- a/libibverbs/driver.h +++ b/libibverbs/driver.h @@ -129,8 +129,6 @@ struct verbs_device_ops { struct ibv_context *ctx); struct verbs_device *(*alloc_device)(struct verbs_sysfs_dev *sysfs_dev); - struct verbs_device *(*init_device)(const char *uverbs_sys_path, - int abi_version); void (*uninit_device)(struct verbs_device *device); }; diff --git a/libibverbs/init.c b/libibverbs/init.c index 2369a1df6e1fbd..d75d70b195a6f6 100644 --- a/libibverbs/init.c +++ b/libibverbs/init.c @@ -367,22 +367,14 @@ static struct verbs_device *try_driver(const struct verbs_device_ops *ops, struct ibv_device *dev; char value[16]; - if (ops->alloc_device) { - if (!match_device(ops, sysfs_dev)) - return NULL; + if (!match_device(ops, sysfs_dev)) + return NULL; - vdev = ops->alloc_device(sysfs_dev); - if (!vdev) { - fprintf(stderr, PFX - "Fatal: couldn't allocate device for %s\n", - sysfs_dev->ibdev_path); - return NULL; - } - } else { - vdev = - ops->init_device(sysfs_dev->sysfs_path, sysfs_dev->abi_ver); - if (!vdev) - return NULL; + vdev = ops->alloc_device(sysfs_dev); + if (!vdev) { + fprintf(stderr, PFX "Fatal: couldn't allocate device for %s\n", + sysfs_dev->ibdev_path); + return NULL; } vdev->ops = ops;