Re: [PATCH v2 3/4] platform: x86: dell-*: Call led_notify_brightness_change on kbd brightness change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 23 October 2016 21:46:51 Hans de Goede wrote:
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index da2fe18..f86e774 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -319,6 +319,11 @@ static void dell_wmi_process_key(int type, int code)
>  	if (type == 0x0000 && code == 0xe025 && !wmi_requires_smbios_request)
>  		return;
>  
> +	if (type == 0x0011 && (code == 0x01e1 || code == 0x02ea ||
> +			 code == 0x02eb || code == 0x02ec || code == 0x02f6))
> +		dell_smbios_call_notifier(
> +			dell_smbios_kbd_backlight_brightness_changed, NULL);
> +
>  	sparse_keymap_report_entry(dell_wmi_input_dev, key, 1, true);
>  }
>  

This part of patch is ugly. Some random numbers are checked and then
notifier is called. We already have big table with explanation of those
events... It is not possible to extend it with some flag or somehow
other that value should be called via notifier?

Btw, personally I would use uppercase DELL_SMBIOS_KBD_... name from that
enum, but I do not know what is correct coding style here for kernel.

-- 
Pali Rohár
pali.rohar@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux