mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
infiniband: utilize the new cdev_set_parent function
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>
This commit is contained in:
parent
a0d78193dc
commit
985087157c
3 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue