On Mon, Nov 26, 2018 at 7:13 PM Takashi Iwai tiwai@suse.de wrote:
In the upcoming change, the binding of audio mute / mic-mute LED controls will be switched with LED trigger. This patch is the last piece of preparation: adding the audio mute / mic-mute LED class devices to thinkpad_acpi driver.
Two devices, tpacpi::mute and tpacpi::micmute, will be added for controlling the mute LED and mic-mute LED, respectively.
Also this selects CONFIG_LEDS_TRIGGERS and CONFIG_LEDS_TRIGGERS_AUDIO unconditionally. Strictly speaking, these aren't 100% mandatory, but leaving these manual selections would lead to a functional regression easily once after converting from the dynamic symbol binding to the LEDs trigger in a later patch.
if (!ACPI_SUCCESS(acpi_get_handle(hkey_handle, t->name, &temp))) {
ACPI_FAILURE()
t->state = -ENODEV;
continue;
}
err = led_classdev_register(&tpacpi_pdev->dev, &mute_led_cdev[i]);
if (err < 0) {
while (--i >= 0)
Needs { } due to two liner below.
Might be converted to simple
while (i--) { ... }
btw.
if (led_tables[i].state >= 0)
led_classdev_unregister(&mute_led_cdev[i]);
return err;
}
-- With Best Regards, Andy Shevchenko