On Fri, Aug 29, 2014 at 03:01:00PM +0200, Daniel Vetter wrote:
On Fri, Aug 29, 2014 at 12:12:43PM +0200, David Herrmann wrote:
One step closer to dropping all the drm_bus_* code: Add a driver->set_busid() callback and make all drivers use the generic helpers. Nouveau is the only driver that uses two different bus-types with the same drm_driver. This is totally broken if both buses are available on the same machine (unlikely, but lets be safe). Therefore, we create two different drivers for each platform during module_init() and set the set_busid() callback respectively.
Signed-off-by: David Herrmann dh.herrmann@gmail.com
This has a bit a midlayer smell to it tbh, we don't really need a set_busid callback I think. Instead there's just two cases:
- The crazy implementation for pci devices. But we already have dev->pdev, so the core can figure this out itself.
- Everyone else just sets a static name. For those I think we should just add a drm_dev_set_busid function which they can call in their driver-load function. Well maybe different versions for platform drivers and stuff.
We already have drm_dev_set_unique() for exactly this purpose. I think drivers can just be converted to use that one at a time and when no users are left we can drop drm_*_set_busid().
Thierry