From patchwork Sun Jul 1 03:45:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hunt Xu X-Patchwork-Id: 1143871 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 9F3BADFF7B for ; Sun, 1 Jul 2012 03:37:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F5FF9E83B for ; Sat, 30 Jun 2012 20:37:17 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pz0-f49.google.com (mail-pz0-f49.google.com [209.85.210.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ABE19E754 for ; Sat, 30 Jun 2012 20:36:49 -0700 (PDT) Received: by dadm1 with SMTP id m1so6766170dad.36 for ; Sat, 30 Jun 2012 20:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=sOCu0afmKzYLloJ7udKuROwhQQ7Xr+NXcn6c4zxXYcQ=; b=d/Temc3ckmuyyowU8edS2msJHwwYMXHxdBauTf1FeQ43tN02TMlNEGLcrcCjhF3UPm GF9/I1M5z6B5f+zGQKAoIRqJNiN+wtp+wYPmyWlFoS5Vcs4uouSSTaa2oFo6GSsOIVe7 VNRShwl3h5F1z5+IXe7gOO3M2H4TcpaMenSkoQuTm04pCpqfBt081DGcRrvwT/zw4AIf IkpPu2ZU+WFoTK6SccUWXtZkqnFeaAJQ/vD5ZBGKL0W/ktIjdbUK9UZMzgO3I3g0dJuD xHZVD++Ezbmr0GW1zAWrs2ZGixkHVXBHs3jM4Exwjyw92smJTEVtKvh2r3Tzv6yEdfZI /smA== Received: by 10.66.75.104 with SMTP id b8mr11668379paw.40.1341113809504; Sat, 30 Jun 2012 20:36:49 -0700 (PDT) Received: from localhost.localdomain ([114.245.254.253]) by mx.google.com with ESMTPS id he9sm9554810pbc.68.2012.06.30.20.36.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 30 Jun 2012 20:36:48 -0700 (PDT) From: Hunt Xu To: intel-gfx@lists.freedesktop.org Date: Sun, 1 Jul 2012 11:45:07 +0800 Message-Id: <1341114307-6319-1-git-send-email-mhuntxu@gmail.com> X-Mailer: git-send-email 1.7.11.1 Subject: [Intel-gfx] [PATCH] drm/i915: make rc6 in sysfs functions conditional X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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 Commit 0136db586c028f71e7cc21cc183064ff0d5919c8 merges rc6 information into the power group. However, when compiled with CONFIG_PM not set, modprobing i915 would taint since power_group_name is defined as NULL. This patch makes these rc6 in sysfs functions conditional upon the definition of the CONFIG_PM macro to avoid the above-mentioned problem. Signed-off-by: Hunt Xu --- drivers/gpu/drm/i915/i915_sysfs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c index 79f8344..6d4b001 100644 --- a/drivers/gpu/drm/i915/i915_sysfs.c +++ b/drivers/gpu/drm/i915/i915_sysfs.c @@ -31,6 +31,7 @@ #include #include "i915_drv.h" +#ifdef CONFIG_PM static u32 calc_residency(struct drm_device *dev, const u32 reg) { struct drm_i915_private *dev_priv = dev->dev_private; @@ -109,3 +110,14 @@ void i915_teardown_sysfs(struct drm_device *dev) { sysfs_unmerge_group(&dev->primary->kdev.kobj, &rc6_attr_group); } +#else +void i915_setup_sysfs(struct drm_device *dev) +{ + return; +} + +void i915_teardown_sysfs(struct drm_device *dev) +{ + return; +} +#endif /* CONFIG_PM */