* Remove radeon DRM Kconfig forced options
@ 2014-08-23 21:11 Alec Ari
2014-08-25 2:26 ` Michel Dänzer
0 siblings, 1 reply; 2+ messages in thread
From: Alec Ari @ 2014-08-23 21:11 UTC (permalink / raw)
To: dri-devel
[-- Attachment #1: Type: text/plain, Size: 85 bytes --]
Based against 3.17-rc1
Makes POWER_SUPPLY HWMON and BACKLIGHT_CLASS_DEVICE optional
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: radeon-kconfig.patch --]
[-- Type: text/x-patch; name="radeon-kconfig.patch", Size: 2293 bytes --]
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index b066bb3..1b7ee01 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -111,9 +111,6 @@ config DRM_RADEON
select DRM_KMS_HELPER
select DRM_KMS_FB_HELPER
select DRM_TTM
- select POWER_SUPPLY
- select HWMON
- select BACKLIGHT_CLASS_DEVICE
select INTERVAL_TREE
help
Choose this option if you have an ATI Radeon graphics card. There
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 23314be..5743b7c 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -633,10 +633,12 @@ static const struct attribute_group hwmon_attrgroup = {
.is_visible = hwmon_attributes_visible,
};
+#ifdef CONFIG_HWMON
static const struct attribute_group *hwmon_groups[] = {
&hwmon_attrgroup,
NULL
};
+#endif
static int radeon_hwmon_init(struct radeon_device *rdev)
{
@@ -653,9 +655,11 @@ static int radeon_hwmon_init(struct radeon_device *rdev)
case THERMAL_TYPE_KV:
if (rdev->asic->pm.get_temperature == NULL)
return err;
+ #ifdef CONFIG_HWMON
rdev->pm.int_hwmon_dev = hwmon_device_register_with_groups(rdev->dev,
"radeon", rdev,
hwmon_groups);
+ #endif
if (IS_ERR(rdev->pm.int_hwmon_dev)) {
err = PTR_ERR(rdev->pm.int_hwmon_dev);
dev_err(rdev->dev,
@@ -669,11 +673,13 @@ static int radeon_hwmon_init(struct radeon_device *rdev)
return err;
}
+#ifdef CONFIG_HWMON
static void radeon_hwmon_fini(struct radeon_device *rdev)
{
if (rdev->pm.int_hwmon_dev)
hwmon_device_unregister(rdev->pm.int_hwmon_dev);
}
+#endif
static void radeon_dpm_thermal_work_handler(struct work_struct *work)
{
@@ -1398,8 +1404,9 @@ static void radeon_pm_fini_old(struct radeon_device *rdev)
device_remove_file(rdev->dev, &dev_attr_power_profile);
device_remove_file(rdev->dev, &dev_attr_power_method);
}
-
+ #ifdef CONFIG_HWMON
radeon_hwmon_fini(rdev);
+ #endif
kfree(rdev->pm.power_state);
}
@@ -1417,8 +1424,9 @@ static void radeon_pm_fini_dpm(struct radeon_device *rdev)
device_remove_file(rdev->dev, &dev_attr_power_method);
}
radeon_dpm_fini(rdev);
-
+ #ifdef CONFIG_HWMON
radeon_hwmon_fini(rdev);
+ #endif
kfree(rdev->pm.power_state);
}
[-- Attachment #3: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: Remove radeon DRM Kconfig forced options
2014-08-23 21:11 Remove radeon DRM Kconfig forced options Alec Ari
@ 2014-08-25 2:26 ` Michel Dänzer
0 siblings, 0 replies; 2+ messages in thread
From: Michel Dänzer @ 2014-08-25 2:26 UTC (permalink / raw)
To: Alec Ari; +Cc: dri-devel
On 24.08.2014 06:11, Alec Ari wrote:
> Based against 3.17-rc1
>
> Makes POWER_SUPPLY HWMON and BACKLIGHT_CLASS_DEVICE optional
Please send a patch generated by git format-patch, preferably sent by
git sen-email.
> @@ -653,9 +655,11 @@ static int radeon_hwmon_init(struct radeon_device *rdev)
> case THERMAL_TYPE_KV:
> if (rdev->asic->pm.get_temperature == NULL)
> return err;
> + #ifdef CONFIG_HWMON
> rdev->pm.int_hwmon_dev = hwmon_device_register_with_groups(rdev->dev,
> "radeon", rdev,
> hwmon_groups);
> + #endif
> if (IS_ERR(rdev->pm.int_hwmon_dev)) {
> err = PTR_ERR(rdev->pm.int_hwmon_dev);
> dev_err(rdev->dev,
#ifdef and #endif need to be at the start of the line.
> @@ -669,11 +673,13 @@ static int radeon_hwmon_init(struct radeon_device *rdev)
> return err;
> }
>
> +#ifdef CONFIG_HWMON
> static void radeon_hwmon_fini(struct radeon_device *rdev)
> {
> if (rdev->pm.int_hwmon_dev)
> hwmon_device_unregister(rdev->pm.int_hwmon_dev);
> }
> +#endif
>
> static void radeon_dpm_thermal_work_handler(struct work_struct *work)
> {
> @@ -1398,8 +1404,9 @@ static void radeon_pm_fini_old(struct radeon_device *rdev)
> device_remove_file(rdev->dev, &dev_attr_power_profile);
> device_remove_file(rdev->dev, &dev_attr_power_method);
> }
> -
> + #ifdef CONFIG_HWMON
> radeon_hwmon_fini(rdev);
> + #endif
> kfree(rdev->pm.power_state);
> }
>
> @@ -1417,8 +1424,9 @@ static void radeon_pm_fini_dpm(struct radeon_device *rdev)
> device_remove_file(rdev->dev, &dev_attr_power_method);
> }
> radeon_dpm_fini(rdev);
> -
> + #ifdef CONFIG_HWMON
> radeon_hwmon_fini(rdev);
> + #endif
> kfree(rdev->pm.power_state);
> }
>
Might be better to move the guard inside radeon_hwmon_fini() than to
guard it at every call site.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-25 2:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-23 21:11 Remove radeon DRM Kconfig forced options Alec Ari
2014-08-25 2:26 ` Michel Dänzer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.