From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 2/5] drm: merge device setup into drm_dev_register() Date: Thu, 3 Oct 2013 15:15:12 +0200 Message-ID: <20131003131512.GF31334@phenom.ffwll.local> References: <1380705818-4065-1-git-send-email-dh.herrmann@gmail.com> <1380705818-4065-3-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by gabe.freedesktop.org (Postfix) with ESMTP id AE165E5CF2 for ; Thu, 3 Oct 2013 06:14:56 -0700 (PDT) Received: by mail-ea0-f169.google.com with SMTP id k11so1089698eaj.14 for ; Thu, 03 Oct 2013 06:14:54 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1380705818-4065-3-git-send-email-dh.herrmann@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: David Herrmann Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org 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 [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