]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/core/user_mad.c
[PATCH] mark struct file_operations const 3
[linux-2.6] / drivers / infiniband / core / user_mad.c
index 1273f8807e849a28f7aec5bba0aef5bd87dbba6c..c069ebeba8e33c18746459830b05c61d8469bd45 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2004 Topspin Communications.  All rights reserved.
- * Copyright (c) 2005 Voltaire, Inc. All rights reserved. 
+ * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
  * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -771,7 +771,7 @@ static int ib_umad_close(struct inode *inode, struct file *filp)
        return 0;
 }
 
-static struct file_operations umad_fops = {
+static const struct file_operations umad_fops = {
        .owner          = THIS_MODULE,
        .read           = ib_umad_read,
        .write          = ib_umad_write,
@@ -846,7 +846,7 @@ static int ib_umad_sm_close(struct inode *inode, struct file *filp)
        return ret;
 }
 
-static struct file_operations umad_sm_fops = {
+static const struct file_operations umad_sm_fops = {
        .owner   = THIS_MODULE,
        .open    = ib_umad_sm_open,
        .release = ib_umad_sm_close
@@ -1032,7 +1032,10 @@ static void ib_umad_add_one(struct ib_device *device)
        struct ib_umad_device *umad_dev;
        int s, e, i;
 
-       if (device->node_type == IB_NODE_SWITCH)
+       if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
+               return;
+
+       if (device->node_type == RDMA_NODE_IB_SWITCH)
                s = e = 0;
        else {
                s = 1;