From patchwork Tue Jul 19 02:19:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 988032 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6J2JfTF010463 for ; Tue, 19 Jul 2011 02:20:04 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2BE0E9E9C8 for ; Mon, 18 Jul 2011 19:19:41 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 391FE9E70A for ; Mon, 18 Jul 2011 19:19:20 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 18 Jul 2011 19:19:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,225,1309762800"; d="scan'208";a="27396737" Received: from ubuntu-hp.sh.intel.com ([10.239.36.131]) by orsmga002.jf.intel.com with ESMTP; 18 Jul 2011 19:19:18 -0700 From: Zhenyu Wang To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Jul 2011 10:19:17 +0800 Message-Id: <1311041957-26617-1-git-send-email-zhenyuw@linux.intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [Intel-gfx] [PATCH] drm/i915: check intel-agp module only for real intel graphics device X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 19 Jul 2011 02:20:04 +0000 (UTC) Move intel-agp module dependence check into device probe function instead of always checking that when loading i915 module, which seems too chatty on non-intel graphics device. Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/i915_drv.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index eb91e2d..b802eb1 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -652,6 +652,11 @@ int i915_reset(struct drm_device *dev, u8 flags) static int __devinit i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { + if (!intel_agp_enabled) { + DRM_ERROR("drm/i915 can't work without intel_agp module!\n"); + return -ENODEV; + } + /* Only bind to function 0 of the device. Early generations * used function 1 as a placeholder for multi-head. This causes * us confusion instead, especially on the systems where both @@ -813,11 +818,6 @@ static struct pci_driver i915_pci_driver = { static int __init i915_init(void) { - if (!intel_agp_enabled) { - DRM_ERROR("drm/i915 can't work without intel_agp module!\n"); - return -ENODEV; - } - driver.num_ioctls = i915_max_ioctl; /*