From patchwork Mon Dec 10 14:32:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10721369 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B8FB13BF for ; Mon, 10 Dec 2018 14:33:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B7B92AAEF for ; Mon, 10 Dec 2018 14:33:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3F292AB14; Mon, 10 Dec 2018 14:33:21 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A1CAD2AB21 for ; Mon, 10 Dec 2018 14:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727935AbeLJOdV (ORCPT ); Mon, 10 Dec 2018 09:33:21 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54673 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbeLJOdV (ORCPT ); Mon, 10 Dec 2018 09:33:21 -0500 Received: by mail-wm1-f67.google.com with SMTP id a62so3738920wmh.4 for ; Mon, 10 Dec 2018 06:33:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GsGL/d5xvOi07yXDF1bZ3pzkFP4JXaHlMpKFDodv9oE=; b=ryZdrC5V6vIN6ImF3enoQNPcf2NgNABVSAfj8X77cmbO5yVpGZ93YJOFOI3EaXZKRQ R2xHmhOijMhIjNQNChsibW3J7+34A9yHOT+O2XJr60JK281ZpiBrLSmp1b5zp768MkC0 amLmvg4V2nfsOSSXbcYhGaLRTitYaGEwQ60JB3pm5LMW2R5KS4+PpSqyEVozT4bPbS6L DxQW5Xon1QEtnZnwEwA/UqOa434yawWZ+0x+51oiyHme2AMFH8CXZRGGVCJcmg5eQY+l mqIOAMd/T9nqWqL5hMW175BqvcM6XUz9InTjh/8+HsWmc0XP4kvN5AHmHL0maSXiZSo2 ln0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GsGL/d5xvOi07yXDF1bZ3pzkFP4JXaHlMpKFDodv9oE=; b=SLh9ExbwKAdHgbY+KqMlwhWF9ceFZaDGhLROH5U04k4RfNFyh5ZgyM8ZEovoqrH64K LjM+ptAhgLhmP1R0RlE1f1J6UWXAqUNPtkmMG5WUGlc53vmwdinfpnxqI9L9PfLdSzwu dgfBK7/tJ95W5TyLe5YY8nAhGZjrovaQ+p+LjklPMfUbM/WAzVbTwQhylNNHGYZ05pD9 t9jTaholx1C981yXShkK2cFXsQDgpOEbUnWSzi5qmWKZ4BoQAphJ6Y7WX+qV3jO5sRc2 dyKNvO2rvwPuPe4O/Ut3W8mwBQpwY43EKTn9nxQtMWefDEDabN/ETVxhBjWhtEyoG+BL THKA== X-Gm-Message-State: AA+aEWY+96pARaFIrjbWN5IfS7IJOYe1IMy5Ul+v98+TvJaSNsLqbQA5 De/8WsH8md2v6BBWHTibhAFc+CZX X-Google-Smtp-Source: AFSGD/WUzhxWfFt+2yVcRltmNOCuw5Wie44pn2piDfwxxhRkEYn+ZAPc8V8AApQblfXbbd/rZaKBGg== X-Received: by 2002:a1c:1d2:: with SMTP id 201mr11675557wmb.69.1544452398534; Mon, 10 Dec 2018 06:33:18 -0800 (PST) Received: from kheib-workstation.redhat.com ([192.116.94.216]) by smtp.gmail.com with ESMTPSA id p74sm14279172wmd.29.2018.12.10.06.33.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 06:33:18 -0800 (PST) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next v4 04/18] RDMA/hfi1: Initialize ib_device_ops struct Date: Mon, 10 Dec 2018 16:32:24 +0200 Message-Id: <20181210143238.10775-5-kamalheib1@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181210143238.10775-1-kamalheib1@gmail.com> References: <20181210143238.10775-1-kamalheib1@gmail.com> MIME-Version: 1.0 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 Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib --- drivers/infiniband/hw/hfi1/verbs.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index 48e11e510358..b861bc1d5414 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c @@ -1616,6 +1616,16 @@ static int get_hw_stats(struct ib_device *ibdev, struct rdma_hw_stats *stats, return count; } +static const struct ib_device_ops hfi1_dev_ops = { + .alloc_hw_stats = alloc_hw_stats, + .alloc_rdma_netdev = hfi1_vnic_alloc_rn, + .get_dev_fw_str = hfi1_get_dev_fw_str, + .get_hw_stats = get_hw_stats, + .modify_device = modify_device, + /* keep process mad in the driver */ + .process_mad = hfi1_process_mad, +}; + /** * hfi1_register_ib_device - register our device with the infiniband core * @dd: the device data structure @@ -1659,14 +1669,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ibdev->owner = THIS_MODULE; ibdev->phys_port_cnt = dd->num_pports; ibdev->dev.parent = &dd->pcidev->dev; - ibdev->modify_device = modify_device; - ibdev->alloc_hw_stats = alloc_hw_stats; - ibdev->get_hw_stats = get_hw_stats; - ibdev->alloc_rdma_netdev = hfi1_vnic_alloc_rn; - /* keep process mad in the driver */ - ibdev->process_mad = hfi1_process_mad; - ibdev->get_dev_fw_str = hfi1_get_dev_fw_str; + ib_set_device_ops(ibdev, &hfi1_dev_ops); strlcpy(ibdev->node_desc, init_utsname()->nodename, sizeof(ibdev->node_desc));