aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-07-08 04:47:22 -0400
committerMatthew Garrett <matthew.garrett@nebula.com>2014-08-16 04:23:50 -0400
commit86ac2735ae09ab012da358d4dff73f3bcad50583 (patch)
treee7828095d31c45acc836b1f5e290d19a0ddaf1e4 /drivers/platform
parentd8c66f62992dac3a92cbc5f16791557100c7a068 (diff)
asus-wmi: backlight_init: Stop treating -ENODEV as if its not an error
When bl_power support got added to asus-wmi, the error handling for it was written to ignore -ENODEV, to avoid not registering a backlight interface for models which have no bl_power control, but do have brightness control. At the same time the error handling for brightness_max was modified to do the same, this is wrong, when there is no brightness_max asus-wmi should not register a backlight interface. Note the caller of asus_wmi_backlight_init already special cases -ENODEV, and will not cause the wmi driver regristration to fail because of a -ENODEV return from asus_wmi_backlight_init. https://bugzilla.redhat.com/show_bug.cgi?id=1097436 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 70aec19f50f3..8a8841668992 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1271,10 +1271,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
1271 int power; 1271 int power;
1272 1272
1273 max = read_brightness_max(asus); 1273 max = read_brightness_max(asus);
1274 1274 if (max < 0)
1275 if (max == -ENODEV)
1276 max = 0;
1277 else if (max < 0)
1278 return max; 1275 return max;
1279 1276
1280 power = read_backlight_power(asus); 1277 power = read_backlight_power(asus);