Re: [PATCH 3/6] platform/x86: thinkpad_acpi: Add audio mute LED classdev support

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

 



On Mon, Nov 26, 2018 at 7:13 PM Takashi Iwai <tiwai@xxxxxxx> 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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux