RDMA/cm: Remove unused cm_class
authorJason Gunthorpe <jgg@nvidia.com>
Wed, 5 Aug 2020 17:28:52 +0000 (14:28 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 18 Aug 2020 18:43:07 +0000 (15:43 -0300)
Previous commits removed all references to the /sys/class/infiniband_cm/
directory represented by the cm_class symbol. Remove the directory and
cm_class.

Fixes: a1a8e4a85cf7 ("rdma: Delete the ib_ucm module")
Link: https://lore.kernel.org/r/0-v1-90096a98c476+205-remove_cm_leftovers_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Documentation/ABI/stable/sysfs-class-infiniband
drivers/infiniband/core/cm.c
include/rdma/ib_cm.h

index 96dfe19..87b11f9 100644 (file)
@@ -258,23 +258,6 @@ Description:
                userspace ABI compatibility of umad & issm devices.
 
 
-What:          /sys/class/infiniband_cm/ucmN/ibdev
-Date:          Oct, 2005
-KernelVersion: v2.6.14
-Contact:       linux-rdma@vger.kernel.org
-Description:
-               (RO) Display Infiniband (IB) device name
-
-
-What:          /sys/class/infiniband_cm/abi_version
-Date:          Oct, 2005
-KernelVersion: v2.6.14
-Contact:       linux-rdma@vger.kernel.org
-Description:
-               (RO) Value is incremented if any changes are made that break
-               userspace ABI compatibility of ucm devices.
-
-
 What:          /sys/class/infiniband_verbs/uverbsN/ibdev
 What:          /sys/class/infiniband_verbs/uverbsN/abi_version
 Date:          Sept, 2005
index dc0558b..9949788 100644 (file)
@@ -201,7 +201,6 @@ static struct attribute *cm_counter_default_attrs[] = {
 struct cm_port {
        struct cm_device *cm_dev;
        struct ib_mad_agent *mad_agent;
-       struct kobject port_obj;
        u8 port_num;
        struct list_head cm_priv_prim_list;
        struct list_head cm_priv_altr_list;
@@ -4295,20 +4294,6 @@ static struct kobj_type cm_counter_obj_type = {
        .default_attrs = cm_counter_default_attrs
 };
 
-static char *cm_devnode(struct device *dev, umode_t *mode)
-{
-       if (mode)
-               *mode = 0666;
-       return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
-}
-
-struct class cm_class = {
-       .owner   = THIS_MODULE,
-       .name    = "infiniband_cm",
-       .devnode = cm_devnode,
-};
-EXPORT_SYMBOL(cm_class);
-
 static int cm_create_port_fs(struct cm_port *port)
 {
        int i, ret;
@@ -4511,12 +4496,6 @@ static int __init ib_cm_init(void)
        get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand);
        INIT_LIST_HEAD(&cm.timewait_list);
 
-       ret = class_register(&cm_class);
-       if (ret) {
-               ret = -ENOMEM;
-               goto error1;
-       }
-
        cm.wq = alloc_workqueue("ib_cm", 0, 1);
        if (!cm.wq) {
                ret = -ENOMEM;
@@ -4531,8 +4510,6 @@ static int __init ib_cm_init(void)
 error3:
        destroy_workqueue(cm.wq);
 error2:
-       class_unregister(&cm_class);
-error1:
        return ret;
 }
 
@@ -4553,7 +4530,6 @@ static void __exit ib_cm_cleanup(void)
                kfree(timewait_info);
        }
 
-       class_unregister(&cm_class);
        WARN_ON(!xa_empty(&cm.local_id_table));
 }
 
index 382427a..e23eb35 100644 (file)
@@ -14,9 +14,6 @@
 #include <rdma/ib_sa.h>
 #include <rdma/rdma_cm.h>
 
-/* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */
-extern struct class cm_class;
-
 enum ib_cm_state {
        IB_CM_IDLE,
        IB_CM_LISTEN,