[PATCH 2/5] drm: merge device setup into drm_dev_register()
Daniel Vetter
daniel at ffwll.ch
Thu Oct 3 15:15:12 CEST 2013
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.
Looks good otherwise.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the dri-devel
mailing list