[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vcu69i4zk=Feewz89BCGvHKn295m1nwm94-eJ3+BSSdAw@mail.gmail.com>
Date: Sun, 24 Mar 2024 22:07:30 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Kate Hsuan <hpa@...hat.com>
Cc: Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>, linux-leds@...r.kernel.org,
platform-driver-x86@...r.kernel.org, Hans de Goede <hdegoede@...hat.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
André Apitzsch <git@...tzsch.eu>,
linux-kernel@...r.kernel.org, Sebastian Reichel <sre@...nel.org>, linux-pm@...r.kernel.org
Subject: Re: [PATCH v5 RESEND 3/6] leds: core: Add led_mc_set_brightness() function
On Sun, Mar 24, 2024 at 5:02 PM Kate Hsuan <hpa@...hat.com> wrote:
>
> From: Hans de Goede <hdegoede@...hat.com>
>
> Add a new led_mc_set_brightness() function for in kernel color/brightness
> changing of multi-color LEDs.
>
> led-class-multicolor can be build as a module and led_mc_set_brightness()
> will have builtin callers, so put led_mc_set_brightness() inside led-core
the builtin
> instead, just like how led_set_brightness() is part of the core and not
> of the led-class object.
>
> This also adds a new LED_MULTI_COLOR led_classdev flag to allow
> led_mc_set_brightness() to verify that it is operating on a multi-color
> LED classdev, avoiding casting the passed in LED classdev to a multi-color
> LED classdev, when it actually is not a multi-color LED.
..
> +/*
> + * This is a led-core function because just like led_set_brightness()
> + * it is used in kernel by e.g. triggers.
in the kernel
> + */
..
> + if (!(led_cdev->flags & LED_MULTI_COLOR)) {
> + dev_err_once(led_cdev->dev, "%s: error not a multi-color LED\n", __func__);
Not sure how __func__ helps here.
> + return;
> + }
> +
> + mcled_cdev = lcdev_to_mccdev(led_cdev);
> + if (num_colors != mcled_cdev->num_colors) {
> + dev_err_once(led_cdev->dev, "%s: error num_colors mismatch %d != %d\n",
Should be '...%u != %u...'.
> + __func__, num_colors, mcled_cdev->num_colors);
Ditto about __func__.
> + return;
> + }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists