Skip to content

Commit 5ab3633

Browse files
Hunt Xudanvet
authored andcommitted
drm/i915: make rc6 in sysfs functions conditional
Commit 0136db5 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. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=45181 Cc: stable@vger.kernel.org Tested-by: Kris Karas <bugs-a12@moonlit-rail.com> Signed-off-by: Hunt Xu <mhuntxu@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent bcf9dcc commit 5ab3633

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/gpu/drm/i915/i915_sysfs.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "intel_drv.h"
3333
#include "i915_drv.h"
3434

35+
#ifdef CONFIG_PM
3536
static u32 calc_residency(struct drm_device *dev, const u32 reg)
3637
{
3738
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -224,3 +225,14 @@ void i915_teardown_sysfs(struct drm_device *dev)
224225
device_remove_bin_file(&dev->primary->kdev, &dpf_attrs);
225226
sysfs_unmerge_group(&dev->primary->kdev.kobj, &rc6_attr_group);
226227
}
228+
#else
229+
void i915_setup_sysfs(struct drm_device *dev)
230+
{
231+
return;
232+
}
233+
234+
void i915_teardown_sysfs(struct drm_device *dev)
235+
{
236+
return;
237+
}
238+
#endif /* CONFIG_PM */

0 commit comments

Comments
 (0)