NAK/CMNT: [PATCH 1/1] [SRU][OEM-OSP1-B] UBUNTU: SAUCE: platform/x86: dell-laptop: don't register platform::micmute if the related tokens don't exist.

Koba Ko koba.ko at canonical.com
Thu May 14 00:21:27 UTC 2020


On Thu, May 14, 2020 at 1:48 AM Sultan Alsawaf <sultan.alsawaf at canonical.com>
wrote:

> Hi,
>
> This change breaks the error path in this function because it can perform
> an
> unregister on the led classdev when it is not registered. It looks like you
> realized this is a problem with your LKML submission, so you should update
> this
> sauce patch accordingly. Also, you should implement the other comments
> that the
> reviewers on LKML left for you [1].
>
> Thanks,
> Sultan
>
> [1] https://patchwork.kernel.org/patch/11533437

Hi Sultan,
As per the message[A], it's not a strong requirement.
How do you think!?
[A]https://www.spinics.net/lists/platform-driver-x86/msg21661.html

>


> On Thu, May 07, 2020 at 06:25:24PM +0800, koba.ko at canonical.com wrote:
> > From: Koba Ko <koba.ko at canonical.com>
> >
> > BugLink: https://bugs.launchpad.net/bugs/1877275
> >
> > Error messge is issued,
> > "platform::micmute: Setting an LED's brightness failed (-19)",
> > Even the device isn't presented.
> >
> > Get the related tokens of SMBIOS, GLOBAL_MIC_MUTE_DISABLE/ENABLE.
> > If one of two tokens doesn't exist, don't register platform::micmute.
> >
> > Signed-off-by: Koba Ko <koba.ko at canonical.com>
> > ---
> >  drivers/platform/x86/dell-laptop.c | 11 +++++++----
> >  1 file changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/platform/x86/dell-laptop.c
> b/drivers/platform/x86/dell-laptop.c
> > index 1e46022fb2c5..afc1ded83e56 100644
> > --- a/drivers/platform/x86/dell-laptop.c
> > +++ b/drivers/platform/x86/dell-laptop.c
> > @@ -2208,10 +2208,13 @@ static int __init dell_init(void)
> >
> >       dell_laptop_register_notifier(&dell_laptop_notifier);
> >
> > -     micmute_led_cdev.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
> > -     ret = led_classdev_register(&platform_device->dev,
> &micmute_led_cdev);
> > -     if (ret < 0)
> > -             goto fail_led;
> > +     if (dell_smbios_find_token(GLOBAL_MIC_MUTE_DISABLE) &&
> > +         dell_smbios_find_token(GLOBAL_MIC_MUTE_ENABLE)) {
> > +             micmute_led_cdev.brightness =
> ledtrig_audio_get(LED_AUDIO_MICMUTE);
> > +             ret = led_classdev_register(&platform_device->dev,
> &micmute_led_cdev);
> > +             if (ret < 0)
> > +                     goto fail_led;
> > +     }
> >
> >       if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
> >               return 0;
> > --
> > 2.17.1
> >
> >
> > --
> > kernel-team mailing list
> > kernel-team at lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200514/323bdda8/attachment-0001.html>


More information about the kernel-team mailing list