Thread (2 messages) flat view 2 messages, 2 authors, 2007-04-24

Re: [PATCH] ib_core: Add missing device link to class device

From: Joachim Fenkes <hidden>
Date: 2007-04-24 12:07:09
Also in: lkml

Roland Dreier [off-list ref] wrote on 23.04.2007 21:17:48:
Hmm, I have links like this on my system already:

the patch actually looks sane but I don't understand why it's needed.
Could you explain?
I had a look at the kernel code -- currently, all device drivers except
ehca do this by themselves:

cxgb3:
1110         dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev);
1111         dev->ibdev.class_dev.dev = &(dev->rdev.rnic_info.pdev->dev);

amso1100:
798         dev->ibdev.dma_device = &dev->pcidev->dev;
799         dev->ibdev.class_dev.dev = &dev->pcidev->dev;

ipath:
1559         dev->dma_device = &dd->pcidev->dev;
1560         dev->class_dev.dev = dev->dma_device;

mthca:
1295         dev->ib_dev.dma_device           = &dev->pdev->dev;
1296         dev->ib_dev.class_dev.dev        = &dev->pdev->dev;

So I think it makes a lot of sense to put the class_dev.dev assignment
into generic ib_core code instead of repeating it in all the drivers.
The respective lines could move out of the drivers in the future but
won't hurt anyone until then.

What's your take on this?

Cheers,
  Joachim

---
Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer
IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Dev. 2)
Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help