Eliminate direct accesses to the driver_data field.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1653989063-20180-1-git-send-email-baihaowen@meizu.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Certain functionality or its implementation in System76 EC firmware may
be different to the proprietary ODM EC firmware. Introduce a new bool,
`has_open_ec`, to guard our specific logic. Detect the use of this by
looking for a custom ACPI method name used in System76 firmware.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Managed devices do not need to be explicitly unregistered or freed, as
this is handled by devres. Drop the call to input_free_device.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
input_free_device only needs to be called if input_register_device
failed, not in all error cases. Per devm_input_allocate_device
documentation, managed devices do not need to be explicitly unregistered
or freed, so do not add any other cleanup for the device.
Fixes: c169971892 ("Address feedback from upstream")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Create the attribute groups for kb_led_color and set the `groups` field
in kb_led. While touching it, also change its show method to use
sysfs_emit() instead of sprintf().
Signed-off-by: Tim Crawford <tcrawford@system76.com>