From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Fenglin Wu <fenglin.wu@oss.qualcomm.com>,
Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] leds: flash: leds-qcom-flash: Fix registry access after re-bind
Date: Thu, 29 May 2025 08:31:17 +0200 [thread overview]
Message-ID: <8b2f664d-8e89-460f-a8df-d3fab13fe889@linaro.org> (raw)
In-Reply-To: <42be0934-2e97-4d02-98df-b5a03195e8ae@quicinc.com>
On 29/05/2025 05:11, Fenglin Wu wrote:
>> -static struct reg_field mvflash_4ch_regs[REG_MAX_COUNT] = {
>> +static const struct reg_field mvflash_4ch_regs[REG_MAX_COUNT] = {
>> REG_FIELD(0x06, 0, 7), /* status1 */
>> REG_FIELD(0x07, 0, 6), /* status2 */
>> REG_FIELD(0x09, 0, 7), /* status3 */
>> @@ -854,11 +854,17 @@ static int qcom_flash_led_probe(struct platform_device *pdev)
>> if (val == FLASH_SUBTYPE_3CH_PM8150_VAL || val == FLASH_SUBTYPE_3CH_PMI8998_VAL) {
>> flash_data->hw_type = QCOM_MVFLASH_3CH;
>> flash_data->max_channels = 3;
>> - regs = mvflash_3ch_regs;
>> + regs = devm_kmemdup(dev, mvflash_3ch_regs, sizeof(mvflash_3ch_regs),
>> + GFP_KERNEL);
>> + if (!regs)
>> + return -ENOMEM;
>> } else if (val == FLASH_SUBTYPE_4CH_VAL) {
>> flash_data->hw_type = QCOM_MVFLASH_4CH;
>> flash_data->max_channels = 4;
>> - regs = mvflash_4ch_regs;
>> + regs = devm_kmemdup(dev, mvflash_4ch_regs, sizeof(mvflash_3ch_regs),
>
> Minor: sizeof(mvflash_4ch_regs)
Copy paste, thanks.
>
Best regards,
Krzysztof
prev parent reply other threads:[~2025-05-29 6:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 19:44 Krzysztof Kozlowski
2025-05-29 3:11 ` Fenglin Wu
2025-05-29 6:31 ` Krzysztof Kozlowski [this message]
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=8b2f664d-8e89-460f-a8df-d3fab13fe889@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=fenglin.wu@oss.qualcomm.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®