infiniband: utilize the new cdev_set_parent function
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 17 Mar 2017 18:48:16 +0000 (12:48 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Mar 2017 05:44:33 +0000 (06:44 +0100)
This replaces the suspect looking cdev.kobj.parent lines with the
equivalent cdev_set_parent function. This is a straightforward change
that's largely cosmetic but it does push the kobj.parent ownership
into char_dev.c where it belongs.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/user_mad.c
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/hw/hfi1/device.c

index aca7ff7abedc33a4e0928b6c2bb2c0904e71bff5..25071b880c94d5405e7f06583d5b8dd7654437ab 100644 (file)
@@ -1183,7 +1183,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
 
        cdev_init(&port->cdev, &umad_fops);
        port->cdev.owner = THIS_MODULE;
-       port->cdev.kobj.parent = &umad_dev->kobj;
+       cdev_set_parent(&port->cdev, &umad_dev->kobj);
        kobject_set_name(&port->cdev.kobj, "umad%d", port->dev_num);
        if (cdev_add(&port->cdev, base, 1))
                goto err_cdev;
@@ -1202,7 +1202,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
        base += IB_UMAD_MAX_PORTS;
        cdev_init(&port->sm_cdev, &umad_sm_fops);
        port->sm_cdev.owner = THIS_MODULE;
-       port->sm_cdev.kobj.parent = &umad_dev->kobj;
+       cdev_set_parent(&port->sm_cdev, &umad_dev->kobj);
        kobject_set_name(&port->sm_cdev.kobj, "issm%d", port->dev_num);
        if (cdev_add(&port->sm_cdev, base, 1))
                goto err_sm_cdev;
index 35c788a32e26d4ea6c88fc5bea4a21217f78f103..f02d7b9cebea70c48a5fe2be4f2a9760657de48e 100644 (file)
@@ -1189,7 +1189,7 @@ static void ib_uverbs_add_one(struct ib_device *device)
        cdev_init(&uverbs_dev->cdev, NULL);
        uverbs_dev->cdev.owner = THIS_MODULE;
        uverbs_dev->cdev.ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops;
-       uverbs_dev->cdev.kobj.parent = &uverbs_dev->kobj;
+       cdev_set_parent(&uverbs_dev->cdev, &uverbs_dev->kobj);
        kobject_set_name(&uverbs_dev->cdev.kobj, "uverbs%d", uverbs_dev->devnum);
        if (cdev_add(&uverbs_dev->cdev, base, 1))
                goto err_cdev;
index bf64b5a7bfd79fd01d0e28268e017cb4e66429a6..bbb6069dec2a443bb065fa167eb23df3614ec515 100644 (file)
@@ -69,7 +69,7 @@ int hfi1_cdev_init(int minor, const char *name,
 
        cdev_init(cdev, fops);
        cdev->owner = THIS_MODULE;
-       cdev->kobj.parent = parent;
+       cdev_set_parent(cdev, parent);
        kobject_set_name(&cdev->kobj, name);
 
        ret = cdev_add(cdev, dev, 1);