From: Hans de Goede <hdegoede@redhat.com>
To: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
linux-input@vger.kernel.org, linux-leds@vger.kernel.org,
alsa-devel@alsa-project.org
Subject: [PATCH 3/3] HID: elan: Remove elan_mute_led_get_brigtness()
Date: Sat, 20 Feb 2021 17:32:11 +0100 [thread overview]
Message-ID: <20210220163211.323178-3-hdegoede@redhat.com> (raw)
In-Reply-To: <20210220163211.323178-1-hdegoede@redhat.com>
The led_classdev already contains a cached value of the last set
brightness, the brightness_get callback is only meant for LED drivers
which can read back the actual / current brightness from the hardware.
Since elan_mute_led_get_brigtness() just returns the last set value
it does not add any functionality, so we can just remove it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/hid/hid-elan.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c
index 6958649ece22..f1ac0443ee67 100644
--- a/drivers/hid/hid-elan.c
+++ b/drivers/hid/hid-elan.c
@@ -410,15 +410,6 @@ static int elan_start_multitouch(struct hid_device *hdev)
return 0;
}
-static enum led_brightness elan_mute_led_get_brigtness(struct led_classdev *led_cdev)
-{
- struct device *dev = led_cdev->dev->parent;
- struct hid_device *hdev = to_hid_device(dev);
- struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
-
- return drvdata->mute_led_state;
-}
-
static int elan_mute_led_set_brigtness(struct led_classdev *led_cdev,
enum led_brightness value)
{
@@ -461,7 +452,6 @@ static int elan_init_mute_led(struct hid_device *hdev)
mute_led->name = "elan:red:mute";
mute_led->default_trigger = "audio-mute";
- mute_led->brightness_get = elan_mute_led_get_brigtness;
mute_led->brightness_set_blocking = elan_mute_led_set_brigtness;
mute_led->max_brightness = LED_ON;
mute_led->flags = LED_HW_PLUGGABLE;
--
2.30.1
next prev parent reply other threads:[~2021-02-20 16:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-20 16:32 [PATCH 1/3] HID: elan: Silence mute LED errors being logged when the device is unplugged Hans de Goede
2021-02-20 16:32 ` [PATCH 2/3] HID: elan: Set default_trigger-s for the mute LED Hans de Goede
2021-02-21 1:45 ` Marek Behún
2021-02-20 16:32 ` Hans de Goede [this message]
2021-02-21 1:47 ` [PATCH 3/3] HID: elan: Remove elan_mute_led_get_brigtness() Marek Behún
2021-02-21 1:46 ` [PATCH 1/3] HID: elan: Silence mute LED errors being logged when the device is unplugged Marek Behún
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210220163211.323178-3-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=alsa-devel@alsa-project.org \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).