[PATCH 2/5] drm: merge device setup into drm_dev_register()

David Herrmann dh.herrmann at gmail.com
Thu Oct 3 15:19:53 CEST 2013


Hi Daniel

On Thu, Oct 3, 2013 at 3:15 PM, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Wed, Oct 02, 2013 at 11:23:35AM +0200, David Herrmann wrote:
>> All bus drivers do device setup themselves. This requires us to adjust all
>> of them if we introduce new core features. Thus, merge all these into a
>> uniform drm_dev_register() helper.
>>
>> Note that this removes the drm_lastclose() error path for AGP as it is
>> horribly broken. Moreover, no bus driver called this in any other error
>> path either. Instead, we use the recently introduced AGP cleanup helpers.
>>
>> We also keep a DRIVER_MODESET condition around pci_set_drvdata() to keep
>> semantics.
>>
>> Signed-off-by: David Herrmann <dh.herrmann at gmail.com>
>
> [snip]
>
>> +int drm_dev_register(struct drm_device *dev)
>> +{
>> +     int ret;
>> +
>> +     mutex_lock(&drm_global_mutex);
>> +
>> +     if (dev->driver->bus->agp_init) {
>> +             ret = dev->driver->bus->agp_init(dev);
>> +             if (ret)
>> +                     goto out_unlock;
>> +     }
>
> Imo this should stay in drm_get_pci_dev since its pci specific - no other
> bus type should ever bother with this really.

You mean I should _move_ it to drm_pci.c? It has never been
pci-specific. But sure, I can do that. It actually makes sense. But
I'd like to do that in a followup patch as it's a semantic change
that's not directly related. I will include it in v2.

Thanks
David


More information about the dri-devel mailing list