Re: [PATCH 00/30] staging: comedi: move 'struct pci_dev *' into comedi_device

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

 



On 2012/07/12 10:02 AM, Alan Cox wrote:
>> I suppose at a later date we could turn that into a union with a short
>> name like u (so comedidev->pcidev would become something like
>> comedidev->u.pcidev), which would allow us to stick a 'struct
>> usb_interface *' or some other hardware device wrapper struct pointer in
>> the same hole.  (Maybe 'h' for 'hardware' would be better than 'u'.)
> 
> The "usual" pattern is to make it a struct device pointer. Then you can
> get to any other kind of device from it.

You mean with container_of(), right?  Actually, 'struct comedi_device'
already has a little-used 'struct device *hw_dev' member that could be
used for this purpose.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>             )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587              )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux