From: Michał Kępień Date: Wed, 5 Apr 2017 06:49:08 +0000 (+0200) Subject: platform/x86: fujitsu-laptop: do not log set_lcd_level() failures in bl_update_status() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d75a4a972ad1ed6d1326c63ae2fb0f9586161b4d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git platform/x86: fujitsu-laptop: do not log set_lcd_level() failures in bl_update_status() Any set_lcd_level() call can fail for one of two reasons: either requested brightness is outside the allowed range or the ACPI method used for setting brightness level is not available. For bl_update_status(), the first case is handled by backlight core, which means bl_update_status() will not even be called if requested brightness is outside the allowed range. The second case will be logged anyway by set_lcd_level() itself, so there is no point in generating another message in bl_update_status(). Remove the superfluous debug message along with a local variable that is now redundant. Signed-off-by: Michał Kępień Reviewed-by: Jonathan Woithe Signed-off-by: Darren Hart (VMware) --- diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 66a5eecf77d3..af36b15515ed 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -428,18 +428,12 @@ static int bl_get_brightness(struct backlight_device *b) static int bl_update_status(struct backlight_device *b) { - int ret; if (b->props.power == FB_BLANK_POWERDOWN) call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x3); else call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x0); - ret = set_lcd_level(b->props.brightness); - if (ret != 0) - vdbg_printk(FUJLAPTOP_DBG_ERROR, - "Unable to adjust LCD brightness, error code %i\n", - ret); - return ret; + return set_lcd_level(b->props.brightness); } static const struct backlight_ops fujitsu_bl_ops = {