RE: [PATCH rdma-next 4/6] IB/umad: Refactor code to use cdev_device_add()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Jason Gunthorpe
> Sent: Thursday, December 20, 2018 11:05 AM
> To: Parav Pandit <parav@xxxxxxxxxxxx>
> Cc: Leon Romanovsky <leon@xxxxxxxxxx>; Doug Ledford
> <dledford@xxxxxxxxxx>; Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA
> mailing list <linux-rdma@xxxxxxxxxxxxxxx>; Ira Weiny <ira.weiny@xxxxxxxxx>;
> Jack Morgenstein <jackm@xxxxxxxxxxxxxxxxxx>
> Subject: Re: [PATCH rdma-next 4/6] IB/umad: Refactor code to use
> cdev_device_add()
> 
> On Wed, Dec 19, 2018 at 11:41:20PM -0700, Parav Pandit wrote:
> 
> > I looked at this during v0 version. Couldn't do it because both issm
> > and umad devices have their ibdev and port files and they are part of
> > single structure. So container_of() from the device cannot teach back
> > to umad_device as offsets for two devices are different.
> > Creating another structure and storing umad_device structure pointer
> > is not worth overhead.
> 
> umad and issm don't share code, do they? I would expect to do the
> appropriate container_of for each struct device?
> 
They share two trival sysfs files. creating one generic structure and putting their devices in such new structure, and reaching back to ib_device was not worth the code.
I think get/set_drvdata() is fine, given that this is get/set on device created by the ib_umad module.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux