From patchwork Sun Oct 21 12:49:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10650783 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 3256414DE for ; Sun, 21 Oct 2018 12:50:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 222F328765 for ; Sun, 21 Oct 2018 12:50:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16FBC2877B; Sun, 21 Oct 2018 12:50:34 +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 A7BB428765 for ; Sun, 21 Oct 2018 12:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727705AbeJUVEq (ORCPT ); Sun, 21 Oct 2018 17:04:46 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:52548 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727603AbeJUVEp (ORCPT ); Sun, 21 Oct 2018 17:04:45 -0400 Received: by mail-wm1-f66.google.com with SMTP id 189-v6so7616258wmw.2 for ; Sun, 21 Oct 2018 05:50:31 -0700 (PDT) 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; bh=v6IFyS8nxSpglKmAFrz0R3qZVVeeILgRT/n7ON8cvGQ=; b=nYKrZdxk2pqaHuNwRlqTlDUjIfJjuVc+co9RMxXOhuM6U/kekZ4+U3noPDbc8fbJ62 Je1dvITsi4nwNPVdGc972K25TcveR7lOczkdo+7qIDd3dv4S75W9Vbhq2tXcSnLSHMN3 L+MkVJJe0CW2CDCG7TJptl3NDMwyq4LWBDpSdRTpjCkXrMaoLrneEscRladVRpvWqvHl 6M68W5w0wNjBbZhBjwDh+v8yDWkB5zMJIAN5pgfGsIj16r6HANwF0AUqQU6whfaaQHap l3Wk/AfjaItPXqD516miZdlgLt+Ec8VI/36wIq3cUWDo6zuTrR0APAXe55qCyPT35YUL oizQ== 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; bh=v6IFyS8nxSpglKmAFrz0R3qZVVeeILgRT/n7ON8cvGQ=; b=Mz2aXCbuqjGrMjKt6WBdSuuXjNVGBovJ2y33bYetAlFRRohWa6VQn7hyd9yniNJa/X Fa4UgSrdwSKj2WlBWkDvd3ZcJ8P+jkGFtRp/GikLl3twbLZFGolAVbQqmPE1+Y3Q4ohT RVMq/ax/QVjjPwre85q7Lv/OWJlKBgTwUDAmJzjgCzCpczqV+9dFT/l4Fl53UTSGQRI0 C+0pyCvB/Unghjd6vniU+R0OTETJR4qvK6n+IVv+1w2mbtsVT8hEJKC0nlQlO7Xrm+lf vrUa2q9mfOdFC0CaWGHbuhy2HtONYo5gLpHZylw/lEbUmUsYrHH4h/ZB4qbX5rtRKBvq 4lIg== X-Gm-Message-State: ABuFfoj3c89VjMmImTCaN4ZVSaaUgd4N7HnLLJgoLLRQDWuRhqoBtD61 YFveUAseLxIhG5wtoXpq8jM= X-Google-Smtp-Source: ACcGV62xvivgcM+o/4e0+7sGYTkMAef90wLqi4OPt1XE6zMmjgRrtNQK7qkdTxZ3EPGPaycBjrkxow== X-Received: by 2002:a1c:7f83:: with SMTP id a125-v6mr12380671wmd.23.1540126230533; Sun, 21 Oct 2018 05:50:30 -0700 (PDT) Received: from kheib-workstation.redhat.com ([192.116.94.216]) by smtp.gmail.com with ESMTPSA id v76-v6sm14375380wmd.32.2018.10.21.05.50.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Oct 2018 05:50:30 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next v2 14/18] RDMA/qib: Initialize ib_device_ops struct Date: Sun, 21 Oct 2018 15:49:49 +0300 Message-Id: <20181021124953.11558-15-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20181021124953.11558-1-kamalheib1@gmail.com> References: <20181021124953.11558-1-kamalheib1@gmail.com> 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/qib/qib_verbs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 4b0f5761a646..2112308b0700 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c @@ -1496,6 +1496,11 @@ static void qib_fill_device_attr(struct qib_devdata *dd) dd->verbs_dev.rdi.wc_opcode = ib_qib_wc_opcode; } +static const struct ib_device_ops qib_dev_ops = { + .modify_device = qib_modify_device, + .process_mad = qib_process_mad, +}; + /** * qib_register_ib_device - register our device with the infiniband core * @dd: the device data structure @@ -1558,8 +1563,6 @@ int qib_register_ib_device(struct qib_devdata *dd) ibdev->node_guid = ppd->guid; ibdev->phys_port_cnt = dd->num_pports; ibdev->dev.parent = &dd->pcidev->dev; - ibdev->modify_device = qib_modify_device; - ibdev->process_mad = qib_process_mad; snprintf(ibdev->node_desc, sizeof(ibdev->node_desc), "Intel Infiniband HCA %s", init_utsname()->nodename); @@ -1627,6 +1630,7 @@ int qib_register_ib_device(struct qib_devdata *dd) } rdma_set_device_sysfs_group(&dd->verbs_dev.rdi.ibdev, &qib_attr_group); + ib_set_device_ops(ibdev, &qib_dev_ops); ret = rvt_register_device(&dd->verbs_dev.rdi, RDMA_DRIVER_QIB); if (ret) goto err_tx;