]> www.infradead.org Git - users/jedix/linux-maple.git/commit
platform/x86:dell-laptop: remove duplicate code w/ battery function
authorAndres Salomon <dilinger@queued.net>
Tue, 20 Aug 2024 07:33:35 +0000 (03:33 -0400)
committerHans de Goede <hdegoede@redhat.com>
Wed, 4 Sep 2024 12:45:34 +0000 (14:45 +0200)
commit66cb96af8394e016df90f51c637b78b59e3429d7
tree68b95be091217b90a07c26f4bb729c66008a220b
parentab58016c68cc5b8c3622e38b7db64994e4833d9f
platform/x86:dell-laptop: remove duplicate code w/ battery function

The dell battery patch added dell_send_request_for_tokenid() and
dell_set_std_token_value(), which encapsulates a very common pattern
when SMBIOS queries are addressed to token->location. This calls them
in various places outside of the dell laptop code, allowing us to delete
a bunch of code.

Also some very minor cleanups:
  - mark the kbd init functions as __init
  - don't read buffer.output unless dell_send_request() was successful.
  - actually return errors from micmute_led_set/mute_led_set instead of
    always returning 0.

Only minor behavior changes; the delayed read of buffer.output and
actually returning errors for the brightness_set_blocking hooks.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Reviewed-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20240820033335.4f68b162@5400
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/dell/dell-laptop.c