]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
RDMA/uverbs: Use cdev_device_add() instead of cdev_add()
authorParav Pandit <parav@mellanox.com>
Wed, 5 Sep 2018 06:47:59 +0000 (09:47 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 5 Sep 2018 22:19:25 +0000 (16:19 -0600)
commitc5c4d92e70f37369b5bdca5e85f9fc55dc2c8a3b
treebb748817d8ea061ab5ce60c05d88e2db0bceb5b3
parentadee9f3f3bbb317c5469f84deba01eef4b86515b
RDMA/uverbs: Use cdev_device_add() instead of cdev_add()

Instead of doing two step process to add char device and create underlying
device, use cdev_device_add() which does both.

Currently a kobject per uverbs_device is created to keep reference to its
holding ib_uverbs_device in addition to its underlying device 'dev'.

Instead just use uverbs_device->dev to keep a reference to.

With this change there is single reference tracker for ib_uverbs_device
structure.

This allows for subsequent patch to registers group attribute as well
using single API cdev_device_add().

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_main.c