Remove radeon DRM Kconfig forced options
Subsystems (3)
Based against 3.17-rc1
Makes POWER_SUPPLY HWMON and BACKLIGHT_CLASS_DEVICE optional
drivers/gpu/drm/Kconfig +0 -3
@@ -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
drivers/gpu/drm/radeon/radeon_pm.c +10 -2
@@ -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); }
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Alec Ari
Based against 3.17-rc1
Makes
POWER_SUPPLYHWMON andBACKLIGHT_CLASS_DEVICEoptional
Please send a patch generated by git format-patch, preferably sent by git sen-email.
drivers/gpu/drm/radeon/radeon_pm.c static int radeon_hwmon_init(struct radeon_device *rdev) · line 665
Quoted 12 lines
drivers/gpu/drm/radeon/radeon_pm.c +2
-0@@ -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.
Quoted 26 lines
drivers/gpu/drm/radeon/radeon_pm.c +4
-1@@ -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); }
drivers/gpu/drm/radeon/radeon_pm.c static void radeon_pm_fini_dpm(struct radeon_device *rdev) · line 1432
Quoted 10 lines
drivers/gpu/drm/radeon/radeon_pm.c +2
-1@@ -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.
Signature · 2 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer