Linux LED subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Arunachalam <arun07172003@gmail.com>
Cc: linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH v2 2/4] leds: lp8788: convert to dev_err_probe()
Date: Thu, 23 Jul 2026 16:56:32 +0000	[thread overview]
Message-ID: <20260723165633.E83C31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260723164612.3146-2-arun07172003@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Low] The commit message description is not capitalized, violating the LED subsystem guidelines.

Pre-existing issues:
- [High] The driver directly mutates a global static configuration structure during initialization, causing cross-contamination between devices or across probes.
--

--- Patch [2]: [PATCH v2 2/4] leds: lp8788: convert to dev_err_probe() ---
commit 757b3eb36736561a1f3fc533b95dcae04a897dbc
Author: Arunachalam <arun07172003@gmail.com>

leds: lp8788: convert to dev_err_probe()

This patch replaces open-coded dev_err() and return sequences with
dev_err_probe() in the lp8788 driver. It improves error handling and properly
manages deferred probing.

> leds: lp8788: convert to dev_err_probe()

[Severity: Low]
This isn't a bug, but should the word "convert" be capitalized to match
the LED subsystem commit naming conventions?

> diff --git a/drivers/leds/leds-lp8788.c b/drivers/leds/leds-lp8788.c
> index 9b9525ccca157..259ac50e8498f 100644
> --- a/drivers/leds/leds-lp8788.c
> +++ b/drivers/leds/leds-lp8788.c
> @@ -143,16 +143,12 @@ static int lp8788_led_probe(struct platform_device *pdev)
>  	mutex_init(&led->lock);
>  
>  	ret = lp8788_led_init_device(led, led_pdata);

[Severity: High]
This is a pre-existing issue, but does modifying the global configuration 
structure cause cross-contamination between devices?

Looking at lp8788_led_init_device() in drivers/leds/leds-lp8788.c:

static int lp8788_led_init_device(struct lp8788_led *led,
                                  struct lp8788_led_platform_data *pdata)
{
        struct lp8788_led_config *cfg = &default_led_config;
        ...
        if (pdata) {
                cfg->scale = pdata->scale;
                cfg->num = pdata->num;
                cfg->iout = pdata->iout_code;
        }

If there are multiple instances, modifying cfg (which points to the
global default_led_config) might cause subsequent instances without platform
data to inherit the mutated configuration rather than the defaults. Could
we make a local copy of the configuration instead?

> -	if (ret) {
> -		dev_err(dev, "led init device err: %d\n", ret);
> -		return ret;
> -	}
> +	if (ret)
> +		return dev_err_probe(dev, ret, "led init device err\n");

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260723164612.3146-1-arun07172003@gmail.com?part=2

  reply	other threads:[~2026-07-23 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 16:46 [PATCH v2 1/4] leds: cobalt-raq: add missing MODULE_DESCRIPTION Arunachalam
2026-07-23 16:46 ` [PATCH v2 2/4] leds: lp8788: convert to dev_err_probe() Arunachalam
2026-07-23 16:56   ` sashiko-bot [this message]
2026-07-23 16:46 ` [PATCH v2 3/4] leds: menf21bmc: " Arunachalam
2026-07-23 16:56   ` sashiko-bot
2026-07-23 16:46 ` [PATCH v2 4/4] leds: 88pm860x: " Arunachalam
2026-07-23 17:02   ` sashiko-bot
2026-07-23 16:56 ` [PATCH v2 1/4] leds: cobalt-raq: add missing MODULE_DESCRIPTION sashiko-bot

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=20260723165633.E83C31F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arun07172003@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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