On Mon, Mar 16, 2020 at 05:05:07PM -0400, Dennis Dalessandro wrote: > From: Kaike Wan <kaike.wan@xxxxxxxxx> > > This patch is implemented to address the concerns raised in: > https://marc.info/?l=linux-rdma&m=158101337614772&w=2 > > The hfi1 driver dynammically allocates a struct device to represent the > cdev in sysfs and devtmpfs (/dev/hfi1_x). On the other hand, the > hfi1_devdata already contains a struct device in its ibdev field > (hfi1_devdata.verbs_dev.rdi.ibdev.dev), and it is therefore possible to > eliminate the dynamical allocation when creating the cdev. Since each > device could be added to the sysfs only once and the function > device_add() is already called for the ibdev in ib_register_device(), > the function cdev_device_add() could not be used to create the cdev, > even though the hfi1_devdata contains both cdev and ibdev in the same > structure. > > This patch eliminates the dynamic allocation by creating the cdev > first, setting up the ibdev, and then calling the ib_register_device() > to add the device to sysfs and devtmpfs. What do the sysfs paths for the cdev look like now? Jason